Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/tox #234

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ are used for versioning (schema follows below):

- Add benchmarks section to the main README.
- Improve docs. Add a dedicated section on files creation.
- Minor clean-up.
- Test against Django 5.1.
- Clean-up.

Expand Down
10 changes: 6 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Contributor guidelines
.. _doc8: https://doc8.readthedocs.io/
.. _ruff: https://beta.ruff.rs/docs/
.. _pip-tools: https://pip-tools.readthedocs.io/
.. _uv: https://docs.astral.sh/uv/
.. _tox: https://tox.wiki
.. _issues: https://github.com/barseghyanartur/fake.py/issues
.. _discussions: https://github.com/barseghyanartur/fake.py/discussions
.. _pull request: https://github.com/barseghyanartur/fake.py/pulls
Expand All @@ -29,8 +31,8 @@ TL;DR:

.. code-block:: sh
pip install pipx --user # Install pipx
pipx install pre-commit # Install pre-commit
curl -LsSf https://astral.sh/uv/install.sh | sh # Install uv
uv tool install pre-commit # Install pre-commit
pre-commit install # Install pre-commit hooks
Installing `pre-commit`_ will ensure you adhere to the project code quality
Expand All @@ -51,7 +53,7 @@ Still, if you want to run checks manually:
Requirements
------------
Requirements are compiled using `pip-tools`_.
Requirements are compiled using `uv`_.

.. code-block:: sh
Expand All @@ -77,7 +79,7 @@ Testing
Check `testing`_.

If you introduce changes or fixes, make sure to test them locally using
all supported environments. For that use tox.
all supported environments. For that use `tox`_.

.. code-block:: sh
Expand Down
89 changes: 49 additions & 40 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,63 +1,72 @@
[tox]
envlist = py39,py310,py311,py312,py313
envlist =
py{39,310,311,312,313}
py{39,310,311,312,313}-{customization,dataclasses,django,hypothesis,lazyfuzzy,pydantic,sqlalchemy,sqlmodel,tortoise}
skip_build = True

[testenv]
passenv = *
allowlist_externals=*
commands =
source $(VENV)
pytest -vrx --dagnose
python manage.py test
cd {toxinidir} && {envpython} -m pip install -e .[all]
{envpython} -m pytest -vrx

[testenv:customization-test]
[testenv:py{39,310,311,312,313}-customization]
changedir = examples/customization
commands =
cd examples/customization/
source $(VENV)
python manage.py test
sh -c 'cd {toxinidir} && {envpython} -m pip install -e .[all]'
{envpython} manage.py test

[testenv:dataclasses-test]
[testenv:py{39,310,311,312,313}-dataclasses]
changedir = examples/dataclasses
commands =
cd examples/dataclasses/
source $(VENV)
python manage.py test
sh -c 'cd {toxinidir} && {envpython} -m pip install -e .[all]'
{envpython} manage.py test

[testenv:django-test]
[testenv:py{39,310,311,312,313}-django]
changedir = examples/django
commands =
cd examples/django/
source $(VENV)
./manage.py test
sh -c 'cd {toxinidir} && {envpython} -m pip install -e .[all]'
{envpython} -m pip install -r requirements.in
{envpython} manage.py test

[testenv:hypothesis-test]
[testenv:py{39,310,311,312,313}-hypothesis]
changedir = examples/hypothesis
commands =
cd examples/hypothesis/
source $(VENV)
python manage.py test
sh -c 'cd {toxinidir} && {envpython} -m pip install -e .[all]'
{envpython} -m pip install -r requirements.in
{envpython} manage.py test

[testenv:lazyfuzzy-test]
[testenv:py{39,310,311,312,313}-lazyfuzzy]
changedir = examples/lazyfuzzy
commands =
cd examples/lazyfuzzy/
source $(VENV)
python manage.py test
sh -c 'cd {toxinidir} && {envpython} -m pip install -e .[all]'
{envpython} manage.py test

[testenv:pydantic-test]
[testenv:py{39,310,311,312,313}-pydantic]
changedir = examples/pydantic
commands =
cd examples/pydantic/
source $(VENV)
python manage.py test
sh -c 'cd {toxinidir} && {envpython} -m pip install -e .[all]'
{envpython} -m pip install -r requirements.in
{envpython} manage.py test

[testenv:sqlalchemy-test]
[testenv:py{39,310,311,312,313}-sqlalchemy]
changedir = examples/sqlalchemy
commands =
cd examples/sqlalchemy/
source $(VENV)
python manage.py test
sh -c 'cd {toxinidir} && {envpython} -m pip install -e .[all]'
{envpython} -m pip install -r requirements.in
{envpython} manage.py test

[testenv:sqlmodel-test]
[testenv:py{39,310,311,312,313}-sqlmodel]
changedir = examples/sqlmodel
commands =
cd examples/sqlmodel/
source $(VENV)
python manage.py test
sh -c 'cd {toxinidir} && {envpython} -m pip install -e .[all]'
{envpython} -m pip install -r requirements.in
{envpython} manage.py test

[testenv:tortoise-test]
[testenv:py{39,310,311,312,313}-tortoise]
changedir = examples/tortoise
commands =
cd examples/tortoise/
source $(VENV)
python manage.py test
sh -c 'cd {toxinidir} && {envpython} -m pip install -e .[all]'
{envpython} -m pip install -r requirements.in
{envpython} manage.py test