Skip to content

Commit

Permalink
Replace pip-tools with poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
pamella committed May 27, 2024
1 parent 70e728d commit f6e4027
Show file tree
Hide file tree
Showing 15 changed files with 2,153 additions and 660 deletions.
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,15 @@ docs/modules.rst
docs/drf_rw_serializers.rst
docs/drf_rw_serializers.*.rst

# Private requirements
requirements/private.in
requirements/private.txt

# tox environment temporary artifacts
tests/__init__.py

# Development task artifacts
*.db
Pipfile

# Visual Studio Code config files
.vscode

# pytest
.pytest_cache/
.pytest_cache/
30 changes: 9 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ clean: ## remove generated byte code, coverage reports, and build artifacts
rm -fr *.egg-info

coverage: clean ## generate and view HTML coverage report
py.test --cov-report html
poetry run pytest --cov-report html
$(BROWSER) htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
Expand All @@ -43,36 +43,24 @@ docs: ## generate Sphinx HTML documentation, including API docs
$(BROWSER) docs/_build/html/index.html


upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -q pip-tools
pip-compile --upgrade -o requirements/dev.txt requirements/base.in requirements/dev.in requirements/quality.in
pip-compile --upgrade -o requirements/doc.txt requirements/base.in requirements/doc.in
pip-compile --upgrade -o requirements/quality.txt requirements/quality.in
pip-compile --upgrade -o requirements/test.txt requirements/base.in requirements/test.in
# Let tox control the Django version for tests
sed '/^django==/d' requirements/test.txt > requirements/test.tmp
mv requirements/test.tmp requirements/test.txt

upgrade_private: ## update requirements/private.txt with the latest packages satisfying requirements/private.in
pip install -q pip-tools
pip-compile --upgrade -o requirements/private.txt requirements/private.in
upgrade: ## update the dependencies in pyproject.toml with the latest versions
poetry update

quality: ## check coding style with pycodestyle and pylint
tox -e quality
poetry run tox -e quality

requirements: ## install development environment requirements
pip install -qr requirements/dev.txt --exists-action w
pip-sync requirements/dev.txt requirements/private.txt requirements/test.txt
poetry install

test: clean ## run tests in the current virtualenv
py.test
poetry run pytest

diff_cover: test
diff-cover coverage.xml
poetry run diff-cover coverage.xml

test-all: ## run tests on every supported Python/Django combination
tox -e quality
tox
poetry run tox -e quality
poetry run tox

validate: quality test ## run tests and quality checks

Expand Down
2,086 changes: 2,086 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[tool.poetry]
name = "drf-rw-serializers"
version = "1.1.1"
description = "Generic views, viewsets and mixins that extend the Django REST Framework ones adding separated serializers for read and write operations"
authors = ["Vinta Software <[email protected]>"]
license = "MIT"
readme = "README.rst"

[tool.poetry.dependencies]
python = "^3.8"
djangorestframework = "^3.15.1"


[tool.poetry.group.dev.dependencies]
django = "^4.2"
tox = "^4.15.0"
wheel = "^0.43.0"
docutils = "^0.20.1"
twine = "^5.1.0"
ruff = "^0.4.5"
prospector = "^1.10.3"


[tool.poetry.group.test.dependencies]
pytest-cov = "^5.0.0"
pytest-django = "^4.8.0"
model-bakery = "^1.18.0"
pytest = "^8.2.1"


[tool.poetry.group.docs.dependencies]
django = "^4.2"
doc8 = "^1.1.1"
readme-renderer = "^43.0"
sphinx = "7.1.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
3 changes: 0 additions & 3 deletions requirements/base.in

This file was deleted.

9 changes: 0 additions & 9 deletions requirements/dev.in

This file was deleted.

Loading

0 comments on commit f6e4027

Please sign in to comment.