Skip to content

Commit

Permalink
Merge pull request #136 from ImperialCollegeLondon/remove-pytest-mypy
Browse files Browse the repository at this point in the history
Remove pytest-mypy
  • Loading branch information
AdrianDAlessandro authored Oct 17, 2024
2 parents 807bd61 + 6dd01bc commit d663e41
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 30 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci-pip-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ jobs:

- name: Install project dependencies
working-directory: my_project
run: pip install .[dev]
run: |
pip install --upgrade pip
pip install -r dev-requirements.txt
pip install -e .
- name: Run mypy
working-directory: my_project
run: mypy .

- name: Run tests
working-directory: my_project
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
working-directory: my_project
run: poetry install

- name: Run mypy
working-directory: my_project
run: poetry run mypy .

- name: Run tests
working-directory: my_project
run: poetry run pytest
Expand Down
11 changes: 10 additions & 1 deletion {{ cookiecutter.project_slug }}/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
- name: Install dependencies
run: poetry install

- name: Run mypy
run: poetry run mypy .

- name: Run tests
run: poetry run pytest
{%- if cookiecutter.mkdocs %}
Expand All @@ -49,7 +52,13 @@ jobs:
{%- endif %}
{%- elif cookiecutter.packaging == "pip-tools" %}
- name: Install dependencies
run: pip install -r dev-requirements.txt
run: |
pip install --upgrade pip
pip install -r dev-requirements.txt
pip install -e .
- name: Run mypy
run: mypy .

- name: Run tests
run: pytest
Expand Down
3 changes: 2 additions & 1 deletion {{ cookiecutter.project_slug }}/README.pip-tools.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ To get started:
source .venv/bin/activate # with Powershell on Windows: `.venv\Scripts\Activate.ps1`
```

1. Install development requirements:
1. Install development requirements and the package in editable mode:

```bash
pip install -r dev-requirements.txt
pip install -e .
```
{% if cookiecutter.mkdocs %}
1. (Optionally) install tools for building documentation:
Expand Down
25 changes: 8 additions & 17 deletions {{ cookiecutter.project_slug }}/dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#
# pip-compile --extra=dev --output-file=dev-requirements.txt pyproject.toml
#
attrs==24.2.0
# via pytest-mypy
build==1.2.2.post1
# via pip-tools
cfgv==3.4.0
Expand All @@ -17,17 +15,13 @@ coverage[toml]==7.6.3
distlib==0.3.9
# via virtualenv
filelock==3.16.1
# via
# pytest-mypy
# virtualenv
# via virtualenv
identify==2.6.1
# via pre-commit
iniconfig==2.0.0
# via pytest
mypy==1.11.2
# via
# datahub (pyproject.toml)
# pytest-mypy
# via {{ cookiecutter.project_slug }} (pyproject.toml)
mypy-extensions==1.0.0
# via mypy
nodeenv==1.9.1
Expand All @@ -37,33 +31,30 @@ packaging==24.1
# build
# pytest
pip-tools==7.4.1
# via datahub (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
platformdirs==4.3.6
# via virtualenv
pluggy==1.5.0
# via pytest
pre-commit==4.0.0
# via datahub (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
pyproject-hooks==1.2.0
# via
# build
# pip-tools
pytest==8.3.3
# via
# datahub (pyproject.toml)
# {{ cookiecutter.project_slug }} (pyproject.toml)
# pytest-cov
# pytest-mock
# pytest-mypy
pytest-cov==5.0.0
# via datahub (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
pytest-mock==3.14.0
# via datahub (pyproject.toml)
pytest-mypy==0.10.3
# via datahub (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
pyyaml==6.0.2
# via pre-commit
ruff==0.6.8
# via datahub (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
typing-extensions==4.12.2
# via mypy
virtualenv==20.26.6
Expand Down
14 changes: 7 additions & 7 deletions {{ cookiecutter.project_slug }}/doc-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,27 @@ mkdocs==1.6.1
# mkdocs-material
# mkdocs-section-index
# mkdocstrings
# my_project (pyproject.toml)
# {{ cookiecutter.project_slug }} (pyproject.toml)
mkdocs-autorefs==1.2.0
# via mkdocstrings
mkdocs-gen-files==0.5.0
# via my_project (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
mkdocs-get-deps==0.2.0
# via mkdocs
mkdocs-literate-nav==0.6.1
# via my_project (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
mkdocs-material==9.5.40
# via my_project (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
mkdocs-material-extensions==1.3.1
# via mkdocs-material
mkdocs-section-index==0.3.9
# via my_project (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
mkdocstrings==0.26.1
# via
# mkdocstrings-python
# my_project (pyproject.toml)
# {{ cookiecutter.project_slug }} (pyproject.toml)
mkdocstrings-python==1.11.1
# via my_project (pyproject.toml)
# via {{ cookiecutter.project_slug }} (pyproject.toml)
packaging==24.1
# via mkdocs
paginate==0.5.7
Expand Down
5 changes: 2 additions & 3 deletions {{ cookiecutter.project_slug }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ authors = [
python = "^3.12"

[tool.poetry.group.dev.dependencies]
mypy = "VERSION"
pytest = "VERSION"
pytest-cov = "VERSION"
pytest-mypy = "VERSION"
pytest-mock = "VERSION"
pre-commit = "VERSION"
ruff = "VERSION"
Expand Down Expand Up @@ -55,7 +55,6 @@ dev = [
"pre-commit",
"pytest",
"pytest-cov",
"pytest-mypy",
"pytest-mock",
]
{% if cookiecutter.mkdocs %}doc = [
Expand Down Expand Up @@ -89,7 +88,7 @@ module = "tests.*"
disallow_untyped_defs = false

[tool.pytest.ini_options]
addopts = "-v --mypy -p no:warnings --cov={{ cookiecutter.project_slug }} --cov-report=html --doctest-modules --ignore={{ cookiecutter.project_slug }}/__main__.py"
addopts = "-v -p no:warnings --cov={{ cookiecutter.project_slug }} --cov-report=html --doctest-modules --ignore={{ cookiecutter.project_slug }}/__main__.py"

[tool.ruff]
target-version = "py312"
Expand Down

0 comments on commit d663e41

Please sign in to comment.