Skip to content

Commit 9b272b6

Browse files
committed
switch to pdm
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
1 parent db3b7da commit 9b272b6

File tree

12 files changed

+666
-143
lines changed

12 files changed

+666
-143
lines changed

.github/workflows/build.yaml

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
48

59
jobs:
6-
test:
7-
runs-on: ubuntu-22.04
10+
checks:
11+
runs-on: ${{ matrix.os }}
812
strategy:
913
matrix:
10-
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
15+
os: ["ubuntu-latest", "macos-latest"]
1116
steps:
12-
- uses: actions/checkout@v2
13-
- name: Set up Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v1
15-
with:
16-
python-version: ${{ matrix.python-version }}
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip setuptools wheel
20-
pip install -r requirements.txt -r requirements-dev.txt
21-
- name: Checking the code syntax
22-
run: |
23-
ruff chaosaddons
24-
- name: Run tests
25-
run: |
26-
pip install -e .
27-
pytest tests/
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- name: Set up PDM
21+
uses: pdm-project/setup-pdm@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
cache: true
25+
prerelease: true
2826

29-
build:
30-
runs-on: ubuntu-22.04
31-
steps:
32-
- uses: actions/checkout@v2
33-
- name: Set up Python
34-
uses: actions/setup-python@v1
35-
with:
36-
python-version: '3.8'
37-
- name: Install dependencies
38-
run: |
39-
python -m pip install --upgrade pip setuptools wheel
40-
- name: Build the package
41-
run : |
42-
python3 setup.py build
27+
- name: Ensure lock file is up to date
28+
run: |
29+
pdm lock --check
30+
31+
- name: Install dependencies
32+
run: |
33+
pdm sync -d
34+
35+
- name: Run Lint
36+
run: |
37+
pdm run lint
38+
39+
- name: Run Tests
40+
run: |
41+
pdm run pytest

.github/workflows/release.yaml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,21 @@ on:
99
jobs:
1010
release-to-pypi:
1111
runs-on: ubuntu-22.04
12+
environment: release
13+
permissions:
14+
id-token: write
1215
steps:
13-
- uses: actions/checkout@v2
14-
- name: Set up Python
15-
uses: actions/setup-python@v1
16+
- uses: actions/checkout@v4
17+
- name: Set up PDM
18+
uses: pdm-project/setup-pdm@v4
1619
with:
17-
python-version: '3.8'
18-
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install --upgrade setuptools wheel twine
22-
- name: Build and publish
20+
python-version: "3.8"
21+
- name: Build wheels
22+
run: pdm build --no-sdist
2323
env:
24-
TWINE_USERNAME: __token__
25-
TWINE_PASSWORD: ${{ secrets.PYPI_PWD }}
26-
run: |
27-
python3 setup.py release
28-
twine upload dist/*
29-
# push artifacts for other jobs to use
24+
PDM_BUILD_SCM_VERSION: ${{github.ref_name}}
25+
- name: Publish package distributions to PyPI
26+
uses: pypa/gh-action-pypi-publish@release/v1
3027
- name: Upload packages as artifacts
3128
uses: actions/upload-artifact@v2-preview
3229
with:

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,6 @@ ENV/
102102

103103
.DS_Store
104104
junit-test-results.xml
105-
.vscode/
105+
.vscode/
106+
107+
.pdm-python

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
## [Unreleased][]
44

5-
[Unreleased]: https://github.com/chaostoolkit/chaostoolkit-addons/compare/0.10.0...HEAD
5+
[Unreleased]: https://github.com/chaostoolkit/chaostoolkit-addons/compare/0.11.0...HEAD
6+
7+
## [0.11.0][]
8+
9+
[0.11.0]: https://github.com/chaostoolkit/chaostoolkit-addons/compare/0.10.0...0.11.0
10+
11+
### Changed
12+
13+
* Switched to PDM
14+
* Switched to trusted publisher from pypi
615

716
## [0.10.0][]
817

MANIFEST.in

Lines changed: 0 additions & 5 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ or controls that can benefit the community.
55

66
## Install
77

8-
This package requires Python 3.7+
8+
This package requires Python 3.8+
99

1010
To be used from your experiment, this package must be installed in the Python
1111
environment where [chaostoolkit][] already lives.

pdm.lock

Lines changed: 529 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,80 @@
1-
[build-system]
1+
[project]
2+
name = "chaostoolkit-addons"
3+
dynamic = ["version"]
4+
description = "Addons for your Chaos Toolkit experiments"
5+
authors = [
6+
{name = "Chaos Toolkit", email = "contact@chaostoolkit.org"},
7+
]
8+
requires-python = ">=3.8"
9+
readme = "README.md"
10+
license = {text = "Apache-2.0"}
11+
dependencies = [
12+
"chaostoolkit-lib>=1.42.1",
13+
]
14+
classifiers = [
15+
"Development Status :: 4 - Beta",
16+
"Intended Audience :: Developers",
17+
"License :: Freely Distributable",
18+
"License :: OSI Approved :: Apache Software License",
19+
"Operating System :: OS Independent",
20+
"Programming Language :: Python",
21+
"Programming Language :: Python :: 3",
22+
"Programming Language :: Python :: 3.8",
23+
"Programming Language :: Python :: 3.9",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: Implementation",
28+
"Programming Language :: Python :: Implementation :: CPython",
29+
]
30+
31+
[project.urls]
32+
documentation = "https://chaostoolkit.org"
33+
repository = "https://github.com/chaostoolkit/chaostoolkit-addons"
34+
changelog = "https://github.com/chaostoolkit/chaostoolkit-addons/blob/master/CHANGELOG.md"
35+
36+
[build-system]
237
requires = [
3-
"setuptools>=34.4",
4-
"wheel",
5-
"setuptools_scm>=1.15",
6-
"setuptools_scm_git_archive>=1.0",
38+
"pdm-backend",
39+
]
40+
build-backend = "pdm.backend"
41+
42+
[project.optional-dependencies]
43+
dev = [
44+
"pytest-cov>=4.1.0",
45+
"pytest>=8.1.1",
46+
"coverage>=7.4.4",
47+
"pytest-sugar>=1.0.0",
48+
"ruff>=0.3.3",
749
]
8-
build-backend = "setuptools.build_meta"
50+
51+
[tool]
52+
53+
[tool.pdm]
54+
version = { source = "scm" }
55+
56+
[tool.black]
57+
color = true
58+
line-length = 80
59+
target-version = ['py310']
60+
61+
[tool.mypy]
62+
namespace_packages = true
63+
64+
[tool.isort]
65+
line_length = 80
66+
known_first_party = 'chaosaddons'
67+
multi_line_output = 3
68+
include_trailing_comma = true
69+
force_grid_wrap = 0
70+
combine_as_imports = true
71+
72+
[tool.pytest.ini_options]
73+
minversion = "6.0"
74+
testpaths = ["tests"]
75+
addopts = "-v -rxs --cov chaosaddons --cov-report term-missing:skip-covered -p no:warnings"
76+
77+
[tool.pdm.scripts]
78+
lint = {composite = ["ruff check chaosaddons/", "isort --check-only --profile black chaosaddons/", "black --check --diff chaosaddons/"]}
79+
format = {composite = ["isort --profile black chaosaddons/", "black chaosaddons/", "ruff check chaosaddons/ --fix"]}
80+
test = {cmd = "pytest"}

requirements-dev.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.cfg

Lines changed: 0 additions & 64 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)