Skip to content

Commit

Permalink
Remove pytest in favour of testing with Makefile.
Browse files Browse the repository at this point in the history
Add CI timeout and Py3.7.
Add dependabot.
  • Loading branch information
mnako committed Aug 9, 2023
1 parent d8a7ce8 commit f5a2f3a
Show file tree
Hide file tree
Showing 10 changed files with 256 additions and 530 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ on:
jobs:
test:
runs-on: "ubuntu-latest"
timeout-minutes: 15
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v2

Expand All @@ -21,7 +22,9 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: "Set up PDM"
run: pip install --user pdm==2.6.1
run: |
pip install --user pdm==2.6.1
pdm install
- name: "Test Cookiecutter"
run: make test
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Create Release"
on:
push:
tags:
- 'v*'
- "v*"

jobs:
build:
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
dev-env:
@if [ ! -d "__pypackages__" ]; then pdm install; pdm install --group dev; fi;
test:
rm -rf /tmp/testproject || true
pdm run cookiecutter . --output-dir /tmp --no-input project_name=testproject
cd /tmp/testproject && \
$(MAKE) run && \
$(MAKE) test && \
$(MAKE) build VERSION=0.0.0 && \
$(MAKE) rm
@echo "All tests passed"

test: dev-env
pdm run pytest -vv tests

rm:
rm -rf .mypy_cache/ || true
rm -rf .pytest_cache/ || true
rm -rf __pypackages__/ || true
rm -rf tests/__pycache__/ || true
.PHONY: test
529 changes: 231 additions & 298 deletions pdm.lock

Large diffs are not rendered by default.

25 changes: 1 addition & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,12 @@ authors = [
dependencies = [
"cookiecutter==2.2.3",
]
requires-python = ">=3.8"
requires-python = ">=3.7"
license = {text = "MIT"}

[project.urls]
homepage = ""

[project.optional-dependencies]
dev = [
"pytest==7.4.0",
]
[tool]
[tool.pdm]
[tool.pdm.dev-dependencies]

[build-system]
requires = ["pdm-pep517"]
build-backend = "pdm.pep517.api"

[tool.mypy]
files = "{{ cookiecutter.project_name }}/**/*.py,tests/**/*.py"
exclude = "__pypackages__/"
ignore_missing_imports = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true

[tool.pytest.ini_options]
log_cli = true
log_cli_level = "INFO"
Empty file removed tests/__init__.py
Empty file.
168 changes: 0 additions & 168 deletions tests/test_cookiecutter.py

This file was deleted.

27 changes: 1 addition & 26 deletions {{ cookiecutter.project_name }}/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion {{ cookiecutter.project_name }}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
dependencies = [
"requests==2.31.0",
]
requires-python = ">=3.10"
requires-python = ">=3.11"
license = {text = "MIT"}

[project.urls]
Expand Down

0 comments on commit f5a2f3a

Please sign in to comment.