Skip to content

Commit 09793fc

Browse files
committed
use pip-compile-multi and flit_core instead of pdm
1 parent 4eae558 commit 09793fc

22 files changed

+309
-1258
lines changed

.flake8

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ extend-ignore =
1515
E722
1616
# zip with strict=, requires python >= 3.10
1717
B905
18-
# string formatting opinion, B028 renamed to B907
19-
B028
18+
# string formatting opinion
2019
B907
2120
# up to 88 allowed by bugbear B950
2221
max-line-length = 80

.github/workflows/publish.yaml

+13-18
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,16 @@ jobs:
99
outputs:
1010
hash: ${{ steps.hash.outputs.hash }}
1111
steps:
12-
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
13-
- uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912
12+
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
13+
- uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0
1414
with:
1515
python-version: '3.x'
1616
cache: 'pip'
17-
cache-dependency-path: 'pdm.lock'
18-
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12
19-
with:
20-
path: ~/.cache/pdm
21-
key: ${{ matrix.python }}-pdm-${{ hashFiles('pdm.lock') }}
22-
restore-keys: ${{ matrix.python }}-pdm-
23-
- run: pip install pdm
17+
cache-dependency-path: 'requirements/*.txt'
18+
- run: pip install build
2419
# Use the commit date instead of the current date during the build.
2520
- run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV
26-
- run: pdm build
21+
- run: python -m build
2722
# Generate hashes used for provenance.
2823
- name: generate hash
2924
id: hash
@@ -38,7 +33,7 @@ jobs:
3833
id-token: write
3934
contents: write
4035
# Can't pin with hash due to how this workflow works.
41-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.4.0
36+
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v1.6.0
4237
with:
4338
base64-subjects: ${{ needs.build.outputs.hash }}
4439
create-release:
@@ -63,15 +58,15 @@ jobs:
6358
# files in the draft release.
6459
environment: 'publish'
6560
runs-on: ubuntu-latest
61+
permissions:
62+
id-token: write
6663
steps:
6764
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
6865
# Try uploading to Test PyPI first, in case something fails.
69-
- uses: pypa/gh-action-pypi-publish@c7f29f7adef1a245bd91520e94867e5c6eedddcc
66+
- uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598
7067
with:
71-
password: ${{ secrets.TEST_PYPI_TOKEN }}
72-
repository_url: https://test.pypi.org/legacy/
73-
packages_dir: artifact/
74-
- uses: pypa/gh-action-pypi-publish@c7f29f7adef1a245bd91520e94867e5c6eedddcc
68+
repository-url: https://test.pypi.org/legacy/
69+
packages-dir: artifact/
70+
- uses: pypa/gh-action-pypi-publish@a56da0b891b3dc519c7ee3284aff1fad93cc8598
7571
with:
76-
password: ${{ secrets.PYPI_TOKEN }}
77-
packages_dir: artifact/
72+
packages-dir: artifact/

.github/workflows/tests.yaml

+5-13
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
matrix:
2626
include:
2727
- {name: '3.11', python: '3.11', tox: py311}
28-
- {name: 'Lowest', python: '3.11', tox: py311-lowest}
28+
- {name: 'Lowest', python: '3.11', tox: py311-min}
2929
- {name: '3.10', python: '3.10', tox: py310}
3030
- {name: '3.9', python: '3.9', tox: py39}
3131
- {name: '3.8', python: '3.8', tox: py38}
@@ -37,20 +37,12 @@ jobs:
3737
with:
3838
python-version: ${{ matrix.python }}
3939
cache: 'pip'
40-
cache-dependency-path: 'pdm.lock'
41-
- uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12
42-
with:
43-
path: ~/.cache/pdm
44-
key: ${{ matrix.python }}-pdm-${{ hashFiles('pdm.lock') }}
45-
restore-keys: ${{ matrix.python }}-pdm-
40+
cache-dependency-path: 'requirements/*.txt'
4641
- name: cache mypy
4742
uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12
4843
with:
4944
path: ./.mypy_cache
50-
key: mypy|${{ matrix.python }}|${{ hashFiles('pyproject.toml') }}
45+
key: mypy|${{ matrix.python }}|${{ hashFiles('requirements/mypy.txt') }}
5146
if: matrix.tox == 'typing'
52-
- run: |
53-
pip install pdm
54-
pdm config install.cache true
55-
pdm sync -dG tox
56-
- run: pdm run tox -e ${{ matrix.tox }}
47+
- run: pip install tox
48+
- run: tox r -e ${{ matrix.tox }}

.gitignore

+12-19
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
1-
.DS_Store
2-
*.pyc
3-
*.pyo
4-
*.egg-info/
5-
dist/
6-
build/
7-
docs/_build/
8-
.tox/
9-
.idea/
10-
.pytest_cache/
11-
.mypy_cache/
12-
htmlcov/
13-
.coverage
14-
.coverage.*
15-
.vscode/
16-
env/
17-
venv/
18-
.venv/
19-
.pdm.toml
1+
/.idea/
2+
/.vscode/
3+
/.venv/
4+
__pycache__/
5+
/dist/
6+
/.pytest_cache/
7+
/.coverage
8+
/.coverage.*
9+
/htmlcov/
10+
/.mypy_cache/
11+
/.tox/
12+
/docs/_build/

.readthedocs.yaml

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ build:
33
os: "ubuntu-22.04"
44
tools:
55
python: "3.11"
6-
jobs:
7-
post_install:
8-
- "curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -"
9-
- "VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH ~/.local/bin/pdm sync -dG docs"
6+
python:
7+
install:
8+
- requirements: requirements/docs.txt
9+
- method: pip
10+
path: .
1011
sphinx:
1112
builder: dirhtml
1213
fail_on_warning: true

CONTRIBUTING.rst

+20-17
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ Include the following in your patch:
6161
- Use `Black`_ to format your code. This and other tools will run
6262
automatically if you install `pre-commit`_ using the instructions
6363
below.
64-
- All code and docs should be wrapped at 88 characters.
6564
- Include tests if your patch adds or changes code. Make sure the test
6665
fails without your patch.
6766
- Update any relevant docs pages and docstrings.
@@ -87,43 +86,46 @@ First time setup
8786
- Make sure you have a `GitHub account`_.
8887
- Fork Flask-SQLAlchemy to your GitHub account by clicking the `Fork`_
8988
button.
90-
- `Clone`_ the main repository locally.
89+
- `Clone`_ the main repository locally, replacing ``{username}`` with your GitHub
90+
username.
9191

9292
.. code-block:: text
9393
94-
$ git clone https://github.com/pallets-eco/flask-sqlalchemy
94+
$ git clone https://github.com/{username}/flask-sqlalchemy
9595
$ cd flask-sqlalchemy
9696
97-
- Add your fork as a remote to push your work to. Replace
98-
``{username}`` with your username. This names the remote "fork", the
99-
default Pallets remote is "origin".
97+
- Create a virtualenv.
10098

10199
.. code-block:: text
102100
103-
git remote add fork https://github.com/{username}/flask-sqlalchemy
101+
$ python3 -m venv .venv
102+
$ . .venv/bin/activate
104103
105-
- `Install PDM`_, the tool we use to manage the development environment.
104+
On Windows, activating is different.
106105

107-
- Use PDM to set up the development environment. This automatically creates a
108-
virtualenv, installs development tools, and installs the project in editable mode.
106+
.. code-block:: text
107+
108+
> .venv\Scripts\activate
109+
110+
- Install the development dependencies, then install Flask-SQLAlchemy
111+
in editable mode.
109112

110113
.. code-block:: text
111114
112-
$ pdm sync
115+
$ pip install -r requirements/dev.txt && pip install -e .
113116
114117
- Install the pre-commit hooks.
115118

116119
.. code-block:: text
117120
118-
$ pdm run pre-commit install
121+
$ pre-commit install
119122
120123
.. _latest version of git: https://git-scm.com/downloads
121124
.. _username: https://docs.github.com/en/github/using-git/setting-your-username-in-git
122125
.. _email: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address
123126
.. _GitHub account: https://github.com/join
124127
.. _Fork: https://github.com/pallets-eco/flask-sqlalchemy/fork
125128
.. _Clone: https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#step-2-create-a-local-clone-of-your-fork
126-
.. _Install PDM: https://pdm.fming.dev/latest/#installation
127129

128130

129131
Start coding
@@ -169,15 +171,15 @@ Run the basic test suite with pytest.
169171

170172
.. code-block:: text
171173
172-
$ pdm run pytest
174+
$ pytest
173175
174176
This runs the tests for the current environment, which is usually sufficient. CI will
175177
run the full suite when you submit your pull request. You can run the full test suite in
176178
parallel with tox if you don't want to wait.
177179

178180
.. code-block:: text
179181
180-
$ pdm run tox -p
182+
$ tox p
181183
182184
183185
Running test coverage
@@ -188,8 +190,9 @@ contributing. Collect coverage from the tests and generate a report.
188190

189191
.. code-block:: text
190192
191-
$ pdm run pytest --cov
192-
$ pdm run coverage html
193+
$ pip install "coverage[toml]"
194+
$ coverage run -m pytest
195+
$ coverage html
193196
194197
Open ``htmlcov/index.html`` in your browser to explore the report.
195198

docs/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
66
SPHINXOPTS ?=
7-
SPHINXBUILD ?= pdm run sphinx-build
7+
SPHINXBUILD ?= sphinx-build
88
SOURCEDIR = .
99
BUILDDIR = _build
1010

docs/make.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pushd %~dp0
55
REM Command file for Sphinx documentation
66

77
if "%SPHINXBUILD%" == "" (
8-
set SPHINXBUILD=pdm run sphinx-build
8+
set SPHINXBUILD=sphinx-build
99
)
1010
set SOURCEDIR=.
1111
set BUILDDIR=_build

0 commit comments

Comments
 (0)