Skip to content

Commit

Permalink
PDM switch (#371)
Browse files Browse the repository at this point in the history
* PDM switch

* Tweak hatchling

* Update docs requirements
  • Loading branch information
Tinche authored Jun 1, 2023
1 parent 1183328 commit 0cb1872
Show file tree
Hide file tree
Showing 12 changed files with 1,462 additions and 1,955 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
set -xe
python -VV
python -m site
python -m pip install --upgrade pip wheel poetry==1.3.2
python -m pip install --upgrade pip wheel pdm
python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions
- name: "Run tox targets for ${{ matrix.python-version }}"
run: "python -m tox"
Expand All @@ -56,10 +56,10 @@ jobs:
with:
python-version: "3.9"

- name: "Install poetry, check-wheel-content, and twine"
run: "python -m pip install poetry==1.3.2 twine check-wheel-contents"
- name: "Install pdm, check-wheel-content, and twine"
run: "python -m pip install pdm twine check-wheel-contents"
- name: "Build package"
run: "poetry build"
run: "pdm build"
- name: "List result"
run: "ls -l dist"
- name: "Check wheel contents"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,4 @@ settings.json
.editorconfig
.mypy_cache
.pytest_cache
.pdm-python
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ Ready to contribute? Here's how to set up _cattrs_ for local development.
$ git clone git@github.com:your_name_here/cattrs.git
```

3. Install your local copy into a virtualenv. Assuming you have poetry installed, this is how you set up your fork for local development::
3. Install your local copy into a virtualenv. Assuming you have [PDM](https://pdm.fming.dev/latest/) installed, this is how you set up your fork for local development::

```shell
$ cd cattrs/
$ poetry install --all-extras
$ pdm install -d -G :all
```

4. Create a branch for local development::
Expand All @@ -73,7 +73,6 @@ Now you can make your changes locally.
5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::

```shell
$ poetry shell
$ make lint
$ make test
$ tox
Expand All @@ -100,11 +99,12 @@ Before you submit a pull request, check that it meets these guidelines:
3. The pull request should work for all supported Python versions. Check
[https://github.com/python-attrs/cattrs/actions](https://github.com/python-attrs/cattrs/actions)
and make sure that the tests pass for all supported Python versions.
4. Don't forget to add a line to HISTORY.md.

## Tips

To run a subset of tests:

```shell
$ pytest tests.test_unstructure
$ pdm run pytest tests.test_unstructure
```
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# History

## 23.2.0 (UNRELEASED)
- Use [PDM](https://pdm.fming.dev/latest/) instead of Poetry.

## 23.1.1 (2023-05-30)
- Add `typing_extensions` as a direct dependency on 3.10. ([#369](https://github.com/python-attrs/cattrs/issues/369) [#370](https://github.com/python-attrs/cattrs/pull/370))

Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,21 @@ clean-test: ## remove test and coverage artifacts
rm -fr htmlcov/

lint: ## check style with flake8
poetry run flake8 src/ tests
poetry run black --check src tests docs/conf.py
pdm run flake8 src/ tests
pdm run black --check src tests docs/conf.py

test: ## run tests quickly with the default Python
poetry run pytest -x --ff tests
pdm run pytest -x --ff tests


test-all: ## run tests on every Python version with tox
tox

coverage: ## check code coverage quickly with the default Python
poetry run coverage run --source cattrs -m pytest
pdm run coverage run --source cattrs -m pytest

poetry run coverage report -m
poetry run coverage html
pdm run coverage report -m
pdm run coverage html
$(BROWSER) htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
Expand Down
8 changes: 4 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
furo==2022.9.29
poetry==1.2.0
sphinx-copybutton==0.5.0
myst-parser==0.18.1
furo==2023.3.27
pdm==2.7.0
sphinx-copybutton==0.5.2
myst-parser==1.0.0
Loading

0 comments on commit 0cb1872

Please sign in to comment.