Skip to content

Commit 808c57d

Browse files
authored
Docs: Replace Poetry with Hatch (#68)
1 parent de2afd0 commit 808c57d

File tree

3 files changed

+30
-32
lines changed

3 files changed

+30
-32
lines changed

.github/workflows/publish.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
1-
name: publish
1+
name: Publish
22

33
on:
44
push:
55
tags:
6-
- v*
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
78

89
jobs:
910
publish:
11+
if: github.repository == 'pytest-dev/pytest-base-url'
1012
runs-on: ubuntu-latest
1113
steps:
1214
- uses: actions/checkout@v3
13-
- name: Set up Python
14-
uses: actions/setup-python@v3
1515
with:
16-
python-version: "3.9"
17-
- name: Install poetry
18-
run: curl -sSL https://install.python-poetry.org | python3 -
19-
- name: Configure poetry
20-
run: poetry config virtualenvs.in-project true
21-
- name: Set up cache
22-
uses: actions/cache@v3
16+
fetch-depth: 0
17+
persist-credentials: false
18+
19+
- name: Build and Check Package
20+
uses: hynek/build-and-inspect-python-package@v1
21+
22+
- name: Download Package
23+
uses: actions/download-artifact@v3
24+
with:
25+
name: Packages
26+
path: dist
27+
28+
- name: Publish package to PyPI
29+
uses: pypa/gh-action-pypi-publish@release/v1
2330
with:
24-
path: .venv
25-
key: venv-${{ hashFiles('**/poetry.lock') }}
26-
restore-keys: venv-
27-
- name: Install Dependencies
28-
run: poetry install
29-
- name: Publish
30-
run: >-
31-
poetry publish
32-
--build
33-
--username __token__
34-
--password ${{ secrets.PYPI_TOKEN }}
31+
password: ${{ secrets.PYPI_TOKEN }}

README.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,10 @@ the ``config`` object. This can be used to read/add/modify the metadata:
169169
.. code-block:: python
170170
171171
def pytest_configure(config):
172-
from pytest_metadata.plugin import metadata_key
173-
config.stash[metadata_key]['foo'] = 'bar'
172+
metadata = config.pluginmanager.getplugin("metadata")
173+
if metadata:
174+
from pytest_metadata.plugin import metadata_key
175+
config.stash[metadata_key]['foo'] = 'bar'
174176
175177
Plugin integrations
176178
-------------------

development.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
Development
22
===========
33

4-
To contribute to `pytest-metadata` you can use `Poetry <https://python-poetry.org/>`_ to manage
4+
To contribute to `pytest-metadata` you can use `Hatch <https://hatch.pypa.io/latest/>`_ to manage
55
a python virtual environment and `pre-commit <https://pre-commit.com/>`_ to help you with
66
styling and formatting.
77

88
To setup the virtual environment and pre-commit, run:
99

1010
.. code-block:: bash
1111
12-
$ poetry install
13-
$ poetry run pre-commit install
12+
$ hatch -e test run pre-commit install
1413
15-
If you're not using ``Poetry``, to install ``pre-commit``, run:
14+
If you're not using ``Hatch``, to install ``pre-commit``, run:
1615

1716
.. code-block:: bash
1817
@@ -30,14 +29,14 @@ Running Tests
3029
-------------
3130

3231
You will need `Tox <https://tox.wiki/en/latest/>`_ installed to run the tests
33-
against the supported Python versions. If you're using ``Poetry`` it will be
32+
against the supported Python versions. If you're using ``Hatch`` it will be
3433
installed for you.
3534

36-
With ``Poetry``, run:
35+
With ``Hatch``, run:
3736

3837
.. code-block:: bash
3938
40-
$ poetry run tox
39+
$ hatch -e test run tox
4140
4241
Otherwise, to install and run, do:
4342

@@ -57,6 +56,6 @@ Follow these steps to release a new version of the project:
5756
#. Commit and push the new branch and then create a new pull request
5857
#. Wait for tests and reviews and then merge the branch
5958
#. Once merged, update your local master again (``git pull --rebase upstream master``)
60-
#. Tag the release with the new release version (``git tag v<new tag>``)
59+
#. Tag the release with the new release version (``git tag <new tag>``)
6160
#. Push the tag (``git push upstream --tags``)
6261
#. Done.

0 commit comments

Comments
 (0)