-
Notifications
You must be signed in to change notification settings - Fork 762
Move to modern setuptools with pyproject.toml #1793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
recursive-include src/ * | ||
include Directory.Build.* | ||
include pythonnet.sln | ||
include version.txt | ||
global-exclude **/obj/* **/bin/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,53 @@ | ||
[build-system] | ||
requires = ["setuptools>=42", "wheel", "pycparser"] | ||
requires = ["setuptools>=61", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pythonnet" | ||
description = ".NET and Mono integration for Python" | ||
license = {text = "MIT"} | ||
|
||
readme = "README.rst" | ||
|
||
dependencies = [ | ||
"clr_loader>=0.1.7" | ||
] | ||
|
||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: C#", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Operating System :: MacOS :: MacOS X", | ||
] | ||
|
||
dynamic = ["version"] | ||
|
||
[[project.authors]] | ||
name = "The Contributors of the Python.NET Project" | ||
email = "[email protected]" | ||
|
||
[project.urls] | ||
Homepage = "https://pythonnet.github.io/" | ||
Sources = "https://github.com/pythonnet/pythonnet" | ||
|
||
[tool.setuptools] | ||
zip-safe = false | ||
py-modules = ["clr"] | ||
|
||
[tool.setuptools.dynamic.version] | ||
file = "version.txt" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["pythonnet*"] | ||
|
||
[tool.pytest.ini_options] | ||
xfail_strict = true | ||
testpaths = [ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup, Command, Extension | ||
from setuptools.command.build_ext import build_ext | ||
import distutils | ||
from distutils.command import build | ||
from subprocess import check_output, check_call | ||
from distutils.command.build import build as _build | ||
from setuptools.command.develop import develop as _develop | ||
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel | ||
from setuptools import Distribution | ||
from setuptools import setup, Command | ||
|
||
import sys, os | ||
import os | ||
|
||
# Disable SourceLink during the build until it can read repo-format v1, #1613 | ||
os.environ["EnableSourceControlManagerQueries"] = "false" | ||
|
||
|
||
class DotnetLib: | ||
def __init__(self, name, path, **kwargs): | ||
self.name = name | ||
|
@@ -91,13 +93,6 @@ def run(self): | |
|
||
|
||
# Add build_dotnet to the build tasks: | ||
from distutils.command.build import build as _build | ||
from setuptools.command.develop import develop as _develop | ||
from wheel.bdist_wheel import bdist_wheel as _bdist_wheel | ||
from setuptools import Distribution | ||
import setuptools | ||
|
||
|
||
class build(_build): | ||
sub_commands = _build.sub_commands + [("build_dotnet", None)] | ||
|
||
|
@@ -129,10 +124,6 @@ def finalize_options(self): | |
"bdist_wheel": bdist_wheel, | ||
} | ||
|
||
|
||
with open("README.rst", "r") as f: | ||
long_description = f.read() | ||
|
||
dotnet_libs = [ | ||
DotnetLib( | ||
"python-runtime", | ||
|
@@ -143,35 +134,5 @@ def finalize_options(self): | |
|
||
setup( | ||
cmdclass=cmdclass, | ||
name="pythonnet", | ||
version="3.0.0.dev1", | ||
description=".Net and Mono integration for Python", | ||
url="https://pythonnet.github.io/", | ||
project_urls={ | ||
"Source": "https://github.com/pythonnet/pythonnet", | ||
}, | ||
license="MIT", | ||
author="The Contributors of the Python.NET Project", | ||
author_email="[email protected]", | ||
packages=["pythonnet", "pythonnet.find_libpython"], | ||
install_requires=["clr_loader >= 0.1.7"], | ||
long_description=long_description, | ||
long_description_content_type="text/x-rst", | ||
py_modules=["clr"], | ||
dotnet_libs=dotnet_libs, | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: C#", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Operating System :: Microsoft :: Windows", | ||
"Operating System :: POSIX :: Linux", | ||
"Operating System :: MacOS :: MacOS X", | ||
], | ||
zip_safe=False, | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0.0-dev1 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.