File tree Expand file tree Collapse file tree 6 files changed +40
-19
lines changed Expand file tree Collapse file tree 6 files changed +40
-19
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33 pull_request :
44 schedule :
55 - cron : ' 0 0 * * *' # test daily against git HEAD of dependencies
6+
67name : CI
78jobs :
9+
810 test :
911 runs-on : ubuntu-latest
1012 strategy :
@@ -18,10 +20,16 @@ jobs:
1820 steps :
1921 - name : Check out source code
2022 uses : actions/checkout@v3
21- - name : Set up Python
22- uses : actions/setup-python@v4
23+ with :
24+ fetch-depth : 0
25+ - name : Set up PDM
26+ uses : pdm-project/setup-pdm@v3
2327 with :
2428 python-version : ${{ matrix.python-version }}
29+ - name : Install dependencies
30+ run : |
31+ pip install codecov
32+ pdm install --dev
2533 - name : Install Amaranth release
2634 if : ${{ matrix.amaranth-version != 'git' }}
2735 run : |
3038 if : ${{ matrix.amaranth-version == 'git' }}
3139 run : |
3240 pip install git+https://github.com/amaranth-lang/amaranth.git
33- - name : Test
41+ - name : Run tests
3442 run : |
35- python -m unittest discover
43+ pdm run test
44+ - name : Submit code coverage
45+ run :
46+ codecov
3647
3748 required : # group all required workflows into one for the required status check
3849 needs :
Original file line number Diff line number Diff line change 1+ from pdm .backend ._vendor .packaging .version import Version
2+
3+
4+ # This is done in a PDM build hook without specifying `dynamic = [..., "version"]` to put all
5+ # of the static metadata into pyproject.toml. Tools other than PDM will not execute this script
6+ # and will use the generic version of the documentation URL (which redirects to /latest).
7+ def pdm_build_initialize (context ):
8+ version = Version (context .config .metadata ["version" ])
9+ if version .is_prerelease :
10+ url_version = "latest"
11+ else :
12+ url_version = f"v{ version } "
13+ context .config .metadata ["urls" ]["Documentation" ] += url_version
Original file line number Diff line number Diff line change 11# Project metadata
22
3+ [tool .pdm .version ]
4+ source = " scm"
5+
36[project ]
47dynamic = [" version" ]
58
@@ -15,17 +18,16 @@ dependencies = [
1518]
1619
1720[project .urls ]
21+ "Homepage" = " https://amaranth-lang.org/"
22+ "Documentation" = " https://amaranth-lang.org/docs/amaranth-soc/" # modified in pdm_build.py
1823"Source Code" = " https://github.com/amaranth-lang/amaranth-soc"
1924"Bug Tracker" = " https://github.com/amaranth-lang/amaranth-soc/issues"
2025
2126# Build system configuration
2227
2328[build-system ]
24- requires = [" wheel" , " setuptools>=67.0" , " setuptools_scm[toml]>=6.2" ]
25- build-backend = " setuptools.build_meta"
26-
27- [tool .setuptools_scm ]
28- local_scheme = " node-and-timestamp"
29+ requires = [" pdm-backend" ]
30+ build-backend = " pdm.backend"
2931
3032# Development workflow configuration
3133
@@ -34,7 +36,7 @@ test = [
3436 " coverage" ,
3537]
3638docs = [
37- " sphinx~=5.3 " ,
39+ " sphinx~=7.1 " ,
3840 " sphinx-rtd-theme~=1.2" ,
3941 " sphinx-autobuild" ,
4042]
@@ -43,3 +45,7 @@ docs = [
4345test.composite = [" test-code" ]
4446test-code.env = {PYTHONWARNINGS = " error" }
4547test-code.cmd = " python -m coverage run -m unittest discover -t . -s tests -v"
48+ test-docs.cmd = " sphinx-build -b doctest docs docs/_build"
49+
50+ document.cmd = " sphinx-build docs docs/_build"
51+ document-live.cmd = " sphinx-autobuild docs docs/_build --watch amaranth"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments