Skip to content

Commit 093074c

Browse files
committed
Migrate from setup.py to pyproject.toml.
1 parent ae74f17 commit 093074c

File tree

4 files changed

+29
-34
lines changed

4 files changed

+29
-34
lines changed

.git_archival.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node: $Format:%H$
2+
node-date: $Format:%cI$
3+
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4+
ref-names: $Format:%D$

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git_archival.txt export-subst

pyproject.toml

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
11
[build-system]
2-
requires = ["wheel", "setuptools", "setuptools_scm"]
2+
requires = ["wheel", "setuptools~=67.0", "setuptools_scm[toml]>=6.2"]
33
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
dynamic = ["version"]
7+
8+
name = "amaranth-stdio"
9+
description = "Industry standard I/O for Amaranth HDL"
10+
authors = [{name = "Amaranth HDL contributors"}]
11+
license = {file = "LICENSE.txt"}
12+
13+
dependencies = [
14+
"importlib_metadata; python_version<'3.8'",
15+
# this version requirement needs to be synchronized with the one in .github/workflows/main.yml
16+
"amaranth>=0.3,<0.5",
17+
]
18+
19+
[project.urls]
20+
"Source Code" = "https://github.com/amaranth-lang/amaranth-stdio"
21+
"Bug Tracker" = "https://github.com/amaranth-lang/amaranth-stdio/issues"
22+
23+
[tool.setuptools_scm]
24+
local_scheme = "node-and-timestamp"

setup.py

+2-33
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,4 @@
1-
from setuptools import setup, find_packages
1+
from setuptools import setup
22

33

4-
def scm_version():
5-
def local_scheme(version):
6-
if version.tag and not version.distance:
7-
return version.format_with("")
8-
else:
9-
return version.format_choice("+{node}", "+{node}.dirty")
10-
return {
11-
"relative_to": __file__,
12-
"version_scheme": "guess-next-dev",
13-
"local_scheme": local_scheme
14-
}
15-
16-
17-
setup(
18-
name="amaranth-stdio",
19-
use_scm_version=scm_version(),
20-
author="whitequark",
21-
author_email="whitequark@whitequark.org",
22-
description="Industry standard I/O for Amaranth HDL",
23-
#long_description="""TODO""",
24-
license="BSD",
25-
setup_requires=["wheel", "setuptools", "setuptools_scm"],
26-
install_requires=[
27-
"amaranth>=0.2,<0.5",
28-
"importlib_metadata; python_version<'3.8'",
29-
],
30-
packages=find_packages(),
31-
project_urls={
32-
"Source Code": "https://github.com/amaranth-lang/amaranth-stdio",
33-
"Bug Tracker": "https://github.com/amaranth-lang/amaranth-stdio/issues",
34-
},
35-
)
4+
setup()

0 commit comments

Comments
 (0)