File tree 6 files changed +40
-19
lines changed
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 3
3
pull_request :
4
4
schedule :
5
5
- cron : ' 0 0 * * *' # test daily against git HEAD of dependencies
6
+
6
7
name : CI
7
8
jobs :
9
+
8
10
test :
9
11
runs-on : ubuntu-latest
10
12
strategy :
@@ -18,10 +20,16 @@ jobs:
18
20
steps :
19
21
- name : Check out source code
20
22
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
23
27
with :
24
28
python-version : ${{ matrix.python-version }}
29
+ - name : Install dependencies
30
+ run : |
31
+ pip install codecov
32
+ pdm install --dev
25
33
- name : Install Amaranth release
26
34
if : ${{ matrix.amaranth-version != 'git' }}
27
35
run : |
30
38
if : ${{ matrix.amaranth-version == 'git' }}
31
39
run : |
32
40
pip install git+https://github.com/amaranth-lang/amaranth.git
33
- - name : Test
41
+ - name : Run tests
34
42
run : |
35
- python -m unittest discover
43
+ pdm run test
44
+ - name : Submit code coverage
45
+ run :
46
+ codecov
36
47
37
48
required : # group all required workflows into one for the required status check
38
49
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 1
1
# Project metadata
2
2
3
+ [tool .pdm .version ]
4
+ source = " scm"
5
+
3
6
[project ]
4
7
dynamic = [" version" ]
5
8
@@ -15,17 +18,16 @@ dependencies = [
15
18
]
16
19
17
20
[project .urls ]
21
+ "Homepage" = " https://amaranth-lang.org/"
22
+ "Documentation" = " https://amaranth-lang.org/docs/amaranth-soc/" # modified in pdm_build.py
18
23
"Source Code" = " https://github.com/amaranth-lang/amaranth-soc"
19
24
"Bug Tracker" = " https://github.com/amaranth-lang/amaranth-soc/issues"
20
25
21
26
# Build system configuration
22
27
23
28
[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"
29
31
30
32
# Development workflow configuration
31
33
@@ -34,7 +36,7 @@ test = [
34
36
" coverage" ,
35
37
]
36
38
docs = [
37
- " sphinx~=5.3 " ,
39
+ " sphinx~=7.1 " ,
38
40
" sphinx-rtd-theme~=1.2" ,
39
41
" sphinx-autobuild" ,
40
42
]
@@ -43,3 +45,7 @@ docs = [
43
45
test.composite = [" test-code" ]
44
46
test-code.env = {PYTHONWARNINGS = " error" }
45
47
test-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