Skip to content

Commit 6a14189

Browse files
committed
🔧 Replace poetry with flit/uv
Poetry is outdated and PEP621 un-compliant. Note, `uv sync` will fail currently, due to the lower Python 3.8 requirement. This will be updated in a follow-up
1 parent d5e8465 commit 6a14189

File tree

15 files changed

+123
-405
lines changed

15 files changed

+123
-405
lines changed

‎.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
poetry.lock linguist-generated=true
2-
poetry.lock -diff
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

‎.github/workflows/release.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ jobs:
1818
uses: actions/setup-python@v5
1919
with:
2020
python-version: "3.10"
21-
- name: install Poetry
22-
run: python -m pip install poetry
23-
- name: poetry configure PyPI Token
24-
run: poetry config pypi-token.pypi ${{ secrets.PYPI }}
25-
- name: poetry build and publish PyPi
26-
run: poetry --build publish
21+
- name: install flit
22+
run: pip install flit~=3.4
23+
- name: Build and publish
24+
run: flit publish
25+
env:
26+
FLIT_USERNAME: __token__
27+
FLIT_PASSWORD: ${{ secrets.PYPI }}

‎.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
repos:
22

3+
- repo: https://github.com/ComPWA/taplo-pre-commit
4+
rev: v0.9.3
5+
hooks:
6+
- id: taplo-format
7+
38
- repo: https://github.com/astral-sh/ruff-pre-commit
49
rev: v0.7.0
510
hooks:

‎AUTHORS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ Maintainers
33

44
Daniel Woste <[email protected]>
55

6+
Chris Sewell <[email protected]>
7+
68
Contributors
79
------------
810

@@ -36,6 +38,4 @@ Duodu Randy <[email protected]>
3638

3739
Christian Wappler <[email protected]>
3840

39-
Chris Sewell <[email protected]>
40-
4141
Simon Leiner <[email protected]>

‎MANIFEST.in

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

‎Makefile

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

‎README.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ For filtering and analyzing needs, ``Sphinx-Needs`` provides different, powerful
4747
Installation
4848
============
4949

50-
Using poetry
51-
------------
52-
53-
.. code-block:: bash
54-
55-
poetry add sphinx-needs
56-
5750
Using pip
5851
---------
5952

@@ -79,8 +72,6 @@ Using sources
7972
git clone https://github.com/useblocks/sphinx-needs
8073
cd sphinx-needs
8174
pip install .
82-
# or
83-
poetry install
8475
8576
8677
Activation

‎docs/contributing.rst

Lines changed: 22 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -32,53 +32,44 @@ To develop **Sphinx-Needs** it can be installed, with development extras, into
3232
3333
pip install sphinx-needs[test,benchmark,docs]
3434
35-
or using `Poetry <https://python-poetry.org/>`__ to install the dependencies into an isolated environment:
35+
or using `uv <https://docs.astral.sh/uv/>`__ to install the dependencies into an isolated environment:
3636

37-
1. `Install Poetry <https://python-poetry.org/docs/#installation>`__
38-
39-
2. Install project dependencies
37+
.. code-block:: bash
4038
41-
.. code-block:: bash
39+
uv sync
4240
43-
poetry install --all-extras
41+
To run the formatting and linting suite, `pre-commit <https://pre-commit.com/>`__ is used:
4442

45-
To run the formatting and linting suite, pre-commit is used:
43+
.. code-block:: bash
4644
47-
1. `Install Pre-Commit <https://pre-commit.com/>`__
45+
pre-commit install # to auto-run on every commit
46+
pre-commit run --all-files # to run manually
4847
49-
2. Install the Pre-Commit hooks
48+
To run testing and documentation building, `tox <https://tox.readthedocs.io/>`__ is used:
5049

51-
.. code-block:: bash
50+
.. code-block:: bash
5251
53-
pre-commit install
52+
tox -av # to see all environments
5453
54+
Note, it is recommended to also install the `tox-uv <https://github.com/tox-dev/tox-uv>`__ plugin, which will use `uv` to create isolated environments faster, and to use `pyenv <https://github.com/pyenv/pyenv>`__ to manage multiple Python versions.
5555

5656
Build docs
5757
----------
58-
To build the **Sphinx-Needs** documentation stored under ``/docs``, run:
59-
60-
.. code-block:: bash
6158

62-
# Build HTML pages
63-
make docs-html
64-
65-
or
59+
To build the **Sphinx-Needs** documentation stored under ``/docs``, run:
6660

6761
.. code-block:: bash
6862
69-
# Build PDF pages
70-
make docs-pdf
71-
72-
It will always perform a **clean** build (calls ``make clean`` before the build).
73-
If you want to avoid this, run the related sphinx-commands directly under ``/docs`` (e.g. ``make docs``).
63+
# Build HTML pages with the furo theme,
64+
# and first remove all old build files
65+
CLEAN=true tox -e docs-furo
7466
75-
Check links in docs
76-
~~~~~~~~~~~~~~~~~~~~
77-
To check if all used links in the documentation are still valid, run:
67+
or to build with a different builder:
7868

7969
.. code-block:: bash
8070
81-
make docs-linkcheck
71+
# Check links in the documentation
72+
CLEAN=true BUILDER=linkcheck tox -e docs-furo
8273
8374
8475
Running Tests
@@ -90,11 +81,11 @@ You can either run the tests directly using ``pytest``, in an existing environme
9081
9182
pytest tests/
9283
93-
Or you can use the provided Makefile:
84+
Or use tox (recommended):
9485

9586
.. code-block:: bash
9687
97-
make test
88+
tox -e py38
9889
9990
Note some tests use `syrupy <https://github.com/tophat/syrupy>`__ to perform snapshot testing.
10091
These snapshots can be updated by running:
@@ -208,99 +199,28 @@ You can run the ``make test-js`` command to check all JS testcases.
208199
The ``http_server`` process invoked by the ``make test-js`` command may not terminate properly in some instances.
209200
Kindly check your system's monitoring app to end the process if not terminated automatically.
210201

211-
Linting & Formatting
212-
--------------------
213-
214-
**Sphinx-Needs** uses `pre-commit <https://pre-commit.com/>`__ to run formatting and checking of source code.
215-
This can be run directly using:
216-
217-
.. code-block:: bash
218-
219-
pre-commit run --all-files
220-
221-
or via the provided Makefile:
222-
223-
.. code-block:: bash
224-
225-
make lint
226-
227202
Benchmarks
228203
----------
204+
229205
**Sphinx-Needs** own documentation is used for creating a benchmark for each PR.
230206
If the runtime takes 10% longer as the previous ones, the benchmark test will fail.
231207

232208
Benchmark test cases are available under ``tests/benchmarks``.
233-
And they can be locally executed via ``make benchmark``.
234209

235210
The results for each PR/commit get added to a chart, which is available under
236211
http://useblocks.com/sphinx-needs/bench/index.html.
237212

238213
The benchmark data is stored on the `benchmarks` branch, which is also used by github-pages as
239214
source.
240215

241-
242-
Running Test Matrix
243-
-------------------
244-
245-
This project provides a test matrix for running the tests across a range
246-
of Python and Sphinx versions. This is used primarily for continuous integration.
247-
248-
`Nox <https://nox.thea.codes/en/stable/>`__ is used as a test runner.
249-
250-
Running the matrix tests requires additional system-wide dependencies
251-
252-
1. `Install
253-
Nox <https://nox.thea.codes/en/stable/tutorial.html#installation>`__
254-
2. `Install Nox-Poetry <https://pypi.org/project/nox-poetry/>`__
255-
3. You will also need multiple Python versions available. You can manage
256-
these using `Pyenv <https://github.com/pyenv/pyenv>`__
257-
258-
You can run the test matrix by using the ``nox`` command
259-
260-
.. code-block:: bash
261-
262-
nox
263-
264-
or using the provided Makefile
265-
266-
.. code-block:: bash
267-
268-
make test-matrix
269-
270-
For a full list of available options, refer to the Nox documentation,
271-
and the local :download:`noxfile <../noxfile.py>`.
272-
273-
.. dropdown:: Our noxfile.py
274-
275-
.. literalinclude:: ../noxfile.py
276-
277-
278-
Running Commands
279-
----------------
280-
281-
See the Poetry documentation for a list of commands.
282-
283-
In order to run custom commands inside the isolated environment, they
284-
should be prefixed with ``poetry run`` (ie. ``poetry run <command>``).
285-
286-
List make targets
287-
-----------------
288-
289-
**Sphinx-Needs** uses ``make`` to invoke most development related actions.
290-
291-
Use ``make list`` to get a list of available targets.
292-
293-
.. program-output:: make --no-print-directory --directory ../ list
294-
295216
Publishing a new release
296217
------------------------
297218
There is a release pipeline installed for the CI.
298219

299220
This gets triggered automatically, if a tag is created and pushed.
300221
The tag must follow the format: ``[0-9].[0-9]+.[0-9]``. Otherwise the release jobs won't trigger.
301222

302-
The release jobs will build the source and wheel distribution and try to upload them
303-
to ``test.pypi.org`` and ``pypy.org``.
223+
The release jobs will build the source and wheel distribution and try to upload them.
304224

305225

306226
Structure of the extension's logic

‎docs/ubproject.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ content_required = true
99

1010
[needs]
1111
extra_options = [
12-
"my_extra_option",
13-
"another_option",
14-
"author",
15-
"comment",
16-
"amount",
17-
"hours",
18-
"image",
19-
"config",
20-
"github",
21-
"value",
22-
"unit",
12+
"my_extra_option",
13+
"another_option",
14+
"author",
15+
"comment",
16+
"amount",
17+
"hours",
18+
"image",
19+
"config",
20+
"github",
21+
"value",
22+
"unit",
2323
]
2424
variant_options = ["status"]
2525
show_link_type = false
@@ -310,7 +310,7 @@ grid = "simple"
310310

311311
[needs.layouts.permalink_example.layout]
312312
head = [
313-
"<<meta(\"type_name\")>>: **<<meta(\"title\")>>** <<meta_id()>> <<permalink()>> <<collapse_button(\"meta\", collapsed=\"icon:arrow-down-circle\", visible=\"icon:arrow-right-circle\", initial=False)>> ",
313+
"<<meta(\"type_name\")>>: **<<meta(\"title\")>>** <<meta_id()>> <<permalink()>> <<collapse_button(\"meta\", collapsed=\"icon:arrow-down-circle\", visible=\"icon:arrow-right-circle\", initial=False)>> ",
314314
]
315315
meta = ["<<meta_all(no_links=True)>>", "<<meta_links_all()>>"]
316316

@@ -319,7 +319,7 @@ grid = "simple"
319319

320320
[needs.layouts.detail_view.layout]
321321
head = [
322-
"<<meta(\"type_name\")>>: **<<meta(\"title\")>>** <<meta_id()>> <<permalink()>> <<collapse_button(\"meta\", collapsed=\"icon:arrow-down-circle\", visible=\"icon:arrow-right-circle\", initial=False)>> <<sidebar(\"\")>>",
322+
"<<meta(\"type_name\")>>: **<<meta(\"title\")>>** <<meta_id()>> <<permalink()>> <<collapse_button(\"meta\", collapsed=\"icon:arrow-down-circle\", visible=\"icon:arrow-right-circle\", initial=False)>> <<sidebar(\"\")>>",
323323
]
324324
meta = ["<<meta_all(no_links=True)>>", "<<meta_links_all()>>"]
325325

0 commit comments

Comments
 (0)