Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit04cea3d

Browse files
committed
Move to modern setuptools with pyproject.toml
Also moves the version to a common ̀`version.txt` that is read by boththe .NET and Python builds.
1 parente258cee commit04cea3d

File tree

5 files changed

+59
-49
lines changed

5 files changed

+59
-49
lines changed

‎Directory.Build.props

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
<?xml version="1.0"?>
12
<Project>
23
<PropertyGroup>
3-
<VersionPrefix>3.0.0</VersionPrefix>
4-
<AssemblyCopyright>Copyright (c) 2006-2021 The Contributors of the Python.NET Project</AssemblyCopyright>
4+
<AssemblyCopyright>Copyright (c) 2006-2022 The Contributors of the Python.NET Project</AssemblyCopyright>
55
<AssemblyCompany>pythonnet</AssemblyCompany>
66
<AssemblyProduct>Python.NET</AssemblyProduct>
77
<LangVersion>10.0</LangVersion>
88
<IsPackable>false</IsPackable>
9+
<Version>$([System.IO.File]::ReadAllText("version.txt"))</Version>
910
</PropertyGroup>
1011
<ItemGroup>
1112
<PackageReferenceInclude="Microsoft.CSharp"Version="4.7.0" />

‎MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
recursive-include src/ *
22
include Directory.Build.*
33
include pythonnet.sln
4+
include version.txt
45
global-exclude **/obj/* **/bin/*

‎pyproject.toml

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,53 @@
11
[build-system]
2-
requires = ["setuptools>=42","wheel","pycparser"]
2+
requires = ["setuptools>=61","wheel"]
33
build-backend ="setuptools.build_meta"
44

5+
[project]
6+
name ="pythonnet"
7+
description =".NET and Mono integration for Python"
8+
license = {text ="MIT"}
9+
10+
readme ="README.rst"
11+
12+
dependencies = [
13+
"clr_loader>=0.1.7"
14+
]
15+
16+
classifiers = [
17+
"Development Status :: 5 - Production/Stable",
18+
"Intended Audience :: Developers",
19+
"License :: OSI Approved :: MIT License",
20+
"Programming Language :: C#",
21+
"Programming Language :: Python :: 3",
22+
"Programming Language :: Python :: 3.7",
23+
"Programming Language :: Python :: 3.8",
24+
"Programming Language :: Python :: 3.9",
25+
"Programming Language :: Python :: 3.10",
26+
"Operating System :: Microsoft :: Windows",
27+
"Operating System :: POSIX :: Linux",
28+
"Operating System :: MacOS :: MacOS X",
29+
]
30+
31+
dynamic = ["version"]
32+
33+
[[project.authors]]
34+
name ="The Contributors of the Python.NET Project"
35+
email ="pythonnet@python.org"
36+
37+
[project.urls]
38+
Homepage ="https://pythonnet.github.io/"
39+
Sources ="https://github.com/pythonnet/pythonnet"
40+
41+
[tool.setuptools]
42+
zip-safe =false
43+
py-modules = ["clr"]
44+
45+
[tool.setuptools.dynamic.version]
46+
file ="version.txt"
47+
48+
[tool.setuptools.packages.find]
49+
include = ["pythonnet*"]
50+
551
[tool.pytest.ini_options]
652
xfail_strict =true
753
testpaths = [

‎setup.py

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
#!/usr/bin/env python
22

3-
fromsetuptoolsimportsetup,Command,Extension
4-
fromsetuptools.command.build_extimportbuild_ext
53
importdistutils
6-
fromdistutils.commandimportbuild
7-
fromsubprocessimportcheck_output,check_call
4+
fromdistutils.command.buildimportbuildas_build
5+
fromsetuptools.command.developimportdevelopas_develop
6+
fromwheel.bdist_wheelimportbdist_wheelas_bdist_wheel
7+
fromsetuptoolsimportDistribution
8+
fromsetuptoolsimportsetup,Command
89

9-
importsys,os
10+
importos
1011

1112
# Disable SourceLink during the build until it can read repo-format v1, #1613
1213
os.environ["EnableSourceControlManagerQueries"]="false"
1314

15+
1416
classDotnetLib:
1517
def__init__(self,name,path,**kwargs):
1618
self.name=name
@@ -91,13 +93,6 @@ def run(self):
9193

9294

9395
# Add build_dotnet to the build tasks:
94-
fromdistutils.command.buildimportbuildas_build
95-
fromsetuptools.command.developimportdevelopas_develop
96-
fromwheel.bdist_wheelimportbdist_wheelas_bdist_wheel
97-
fromsetuptoolsimportDistribution
98-
importsetuptools
99-
100-
10196
classbuild(_build):
10297
sub_commands=_build.sub_commands+ [("build_dotnet",None)]
10398

@@ -129,10 +124,6 @@ def finalize_options(self):
129124
"bdist_wheel":bdist_wheel,
130125
}
131126

132-
133-
withopen("README.rst","r")asf:
134-
long_description=f.read()
135-
136127
dotnet_libs= [
137128
DotnetLib(
138129
"python-runtime",
@@ -143,35 +134,5 @@ def finalize_options(self):
143134

144135
setup(
145136
cmdclass=cmdclass,
146-
name="pythonnet",
147-
version="3.0.0.dev1",
148-
description=".Net and Mono integration for Python",
149-
url="https://pythonnet.github.io/",
150-
project_urls={
151-
"Source":"https://github.com/pythonnet/pythonnet",
152-
},
153-
license="MIT",
154-
author="The Contributors of the Python.NET Project",
155-
author_email="pythonnet@python.org",
156-
packages=["pythonnet","pythonnet.find_libpython"],
157-
install_requires=["clr_loader >= 0.1.7"],
158-
long_description=long_description,
159-
long_description_content_type="text/x-rst",
160-
py_modules=["clr"],
161137
dotnet_libs=dotnet_libs,
162-
classifiers=[
163-
"Development Status :: 5 - Production/Stable",
164-
"Intended Audience :: Developers",
165-
"License :: OSI Approved :: MIT License",
166-
"Programming Language :: C#",
167-
"Programming Language :: Python :: 3",
168-
"Programming Language :: Python :: 3.7",
169-
"Programming Language :: Python :: 3.8",
170-
"Programming Language :: Python :: 3.9",
171-
"Programming Language :: Python :: 3.10",
172-
"Operating System :: Microsoft :: Windows",
173-
"Operating System :: POSIX :: Linux",
174-
"Operating System :: MacOS :: MacOS X",
175-
],
176-
zip_safe=False,
177138
)

‎version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.0.0-dev1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp