Skip to content

Commit

Permalink
Merge pull request #170 from FreddyFox892/FST/TomlUpdate
Browse files Browse the repository at this point in the history
Move optional dependencies from `dev_requirements` to `pyproject.toml`
  • Loading branch information
mj0nez authored Oct 7, 2024
2 parents 5d347a4 + 115fc09 commit a0fdc69
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 195 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.tox
.venv
.pytest_cache
.mypy_cache
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"
- package-ecosystem: "pip" # See documentation for possible values
directory: "/dev_requirements/" # Location of package manifests
schedule:
interval: "weekly"
# Maintain dependencies for GitHub Actions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements/requirements-format.txt
pip install .[formatting]
- name: ${{ matrix.tool }} Code Formatter
run: |
${{ matrix.tool }} . --check
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ "3.12" ]
os: [ ubuntu-latest ]
# Specifying a GitHub environment, # Specifying a GitHub environment, which is strongly recommended by PyPI: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
# you have to create an environment in your repository settings and add the environment name here
environment: release
Expand All @@ -52,7 +56,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements/requirements-packaging.txt
pip install .[packaging]
- name: Build wheel and source distributions
run: |
python -m build
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM python:3.8-slim-bookworm

COPY . /app
3 changes: 0 additions & 3 deletions dev_requirements/requirements-format.in

This file was deleted.

20 changes: 0 additions & 20 deletions dev_requirements/requirements-format.txt

This file was deleted.

2 changes: 0 additions & 2 deletions dev_requirements/requirements-linting.in

This file was deleted.

20 changes: 0 additions & 20 deletions dev_requirements/requirements-linting.txt

This file was deleted.

3 changes: 0 additions & 3 deletions dev_requirements/requirements-packaging.in

This file was deleted.

82 changes: 0 additions & 82 deletions dev_requirements/requirements-packaging.txt

This file was deleted.

1 change: 0 additions & 1 deletion dev_requirements/requirements-spell_check.in

This file was deleted.

8 changes: 0 additions & 8 deletions dev_requirements/requirements-spell_check.txt

This file was deleted.

2 changes: 0 additions & 2 deletions dev_requirements/requirements-tests.in

This file was deleted.

14 changes: 0 additions & 14 deletions dev_requirements/requirements-tests.txt

This file was deleted.

4 changes: 0 additions & 4 deletions dev_requirements/requirements-type_check.in

This file was deleted.

16 changes: 0 additions & 16 deletions dev_requirements/requirements-type_check.txt

This file was deleted.

24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@ dependencies = [
]
dynamic = ["readme", "version"]

[project.optional-dependencies]
coverage = []
formatting = [
"black==24.8.0",
"isort==5.13.2"
]
linting = [
"pylint==3.3.1"
]
spell_check = [
"codespell==2.3.0"
]
packaging = [
"build==1.2.2",
"twine==5.1.1"
]
tests = [
"pytest==8.3.3"
]
type_check = [
"mypy==1.11.2",
"types-python-dateutil==2.9.0.20240906",
"types-pytz==2024.2.0.20240913"
]

[project.urls]
Changelog = "https://github.com/mj0nez/bdew-datetimes/releases"
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements.in
# pip-compile --extra=test_packaging pyproject.toml
#
holidays==0.57
# via -r requirements.in
holidays==0.57 ; python_version >= "3.8"
# via bdew_datetimes (pyproject.toml)
python-dateutil==2.9.0.post0
# via
# -r requirements.in
# bdew_datetimes (pyproject.toml)
# holidays
pytz==2024.2
# via -r requirements.in
# via bdew_datetimes (pyproject.toml)
six==1.16.0
# via python-dateutil
15 changes: 8 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ commands = python -m pip install --upgrade pip
# the tests environment is called by the Github action that runs the unit tests
deps =
-r requirements.txt
-r dev_requirements/requirements-tests.txt
.[tests]
setenv = PYTHONPATH = {toxinidir}/src
commands = python -m pytest --basetemp={envtmpdir} {posargs}

[testenv:linting]
# the linting environment runs pylint on the code base
deps =
-r requirements.txt
-r dev_requirements/requirements-linting.txt
.[linting]
setenv = PYTHONPATH = {toxinidir}/src
commands =
pylint bdew_datetimes
Expand All @@ -34,7 +34,7 @@ commands =
# the type_check environment checks the type hints using mypy
deps =
-r requirements.txt
-r dev_requirements/requirements-type_check.txt
.[type_check]
setenv = PYTHONPATH = {toxinidir}/src
commands =
mypy --show-error-codes src/bdew_datetimes
Expand All @@ -43,7 +43,7 @@ commands =
[testenv:format]
# install isort and black and invoke them on the current folder
deps =
-r dev_requirements/requirements-format.txt
.[formatting]
commands =
isort .
black .
Expand All @@ -58,12 +58,13 @@ deps =
{[testenv:format]deps}
pip-tools
commands =
pip-compile --upgrade requirements.in
python -m pip install --upgrade pip
pip install -r requirements.txt

[testenv:test_packaging]
skip_install = true
deps =
-r dev_requirements/requirements-packaging.txt
.[packaging]
commands =
python -m build
twine check dist/*
Expand All @@ -73,7 +74,7 @@ commands =
setenv = PYTHONPATH = {toxinidir}/src
deps =
-r requirements.txt
-r dev_requirements/requirements-spell_check.txt
.[spell_check]
commands =
codespell --ignore-words=domain-specific-terms.txt src/bdew_datetimes
codespell --ignore-words=domain-specific-terms.txt README.md
Expand Down

0 comments on commit a0fdc69

Please sign in to comment.