Skip to content
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
tests:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -28,8 +28,8 @@ jobs:
cache: pip
python-version: ${{ matrix.python-version }}
- run: env | sort
- run: make dev-tests
- run: make tests
- run: make dev-test
- run: make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
{%- if version_between("3.11", minimal_python_version, maximal_python_version) | bool %}
- '3.11'
{%- endif %}
tests:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -37,8 +37,8 @@ jobs:
cache: pip
python-version: {{ '${{ matrix.python-version }}' }}
- run: env | sort
- run: make dev-tests
- run: make tests
- run: make dev-test
- run: make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ lint:
- make dev-lint
- make lint-check
stage: lint_test
tests:
test:
artifacts:
reports:
coverage_report:
Expand All @@ -44,8 +44,8 @@ tests:
- '3.11'
script:
- env | sort
- make dev-tests
- make tests
- make dev-test
- make test
stage: lint_test
package:
only:
Expand Down
6 changes: 3 additions & 3 deletions .gitlab-ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ lint:
- make dev-lint
- make lint-check
stage: lint_test
tests:
test:
artifacts:
reports:
coverage_report:
Expand Down Expand Up @@ -61,8 +61,8 @@ tests:
{%- endif %}
script:
- env | sort
- make dev-tests
- make tests
- make dev-test
- make test
stage: lint_test
package:
only:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repos:
- requirements/docs.txt
- requirements/lint.txt
- requirements/package.txt
- requirements/tests.txt
- requirements/test.txt
id: requirements-txt-fixer
- files: .pre-commit-config.yaml
id: sort-simple-yaml
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"stages",
"default",
"lint",
"tests",
"test",
"package",
"pages",
"release",
Expand Down
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean deepclean install dev black isort mypy ruff toml-sort lint pre-commit tests freeze version build upload docs docs-autobuild docs-coverage reports docs-all
.PHONY: clean deepclean install dev black isort mypy ruff toml-sort lint pre-commit test freeze version build upload docs docs-autobuild docs-coverage reports docs-all

########################################################################################
# Variables
Expand Down Expand Up @@ -48,7 +48,7 @@ dev-%:
# Prepare the development environment.
# Install the pacakge in editable mode with all optional dependencies and pre-commit hoook.
dev:
${PIPRUN} pip install -e .[docs,lint,package,tests] -c constraints/$(or $(SS_CONSTRAINTS_VERSION),default).txt
${PIPRUN} pip install -e .[docs,lint,package,test] -c constraints/$(or $(SS_CONSTRAINTS_VERSION),default).txt
if [ "${CI}" != "true" ] && command -v pre-commit > /dev/null 2>&1; then pre-commit install --hook-type pre-push; fi

########################################################################################
Expand All @@ -57,19 +57,19 @@ dev:

# Check lint with black.
black:
${PIPRUN} python -m black --check docs tests src
${PIPRUN} python -m black --check docs test src

# Check lint with isort.
isort:
${PIPRUN} python -m isort .

# Check lint with mypy.
mypy:
${PIPRUN} python -m mypy docs tests src
${PIPRUN} python -m mypy docs test src

# Check lint with ruff.
ruff:
${PIPRUN} python -m ruff docs tests src
${PIPRUN} python -m ruff docs test src

# Check lint with toml-sort.
toml-sort:
Expand All @@ -83,11 +83,11 @@ lint:
pre-commit run --all-files

########################################################################################
# Tests
# Test
########################################################################################

# Run tests with coverage report.
tests:
# Run test with coverage report.
test:
${PIPRUN} python -m coverage erase
${PIPRUN} python -m coverage run -m pytest
${PIPRUN} python -m coverage report
Expand Down Expand Up @@ -126,7 +126,7 @@ docs-autobuild:

# Generate mypy reports.
docs-mypy:
${PIPRUN} python -m mypy tests src --html-report ${PUBLIC_DIR}/reports/mypy
${PIPRUN} python -m mypy test src --html-report ${PUBLIC_DIR}/reports/mypy

# Generate coverage reports.
docs-coverage:
Expand Down
18 changes: 9 additions & 9 deletions Makefile.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: clean deepclean install dev black isort mypy ruff toml-sort lint pre-commit tests freeze version build upload docs docs-autobuild docs-coverage reports docs-all
.PHONY: clean deepclean install dev black isort mypy ruff toml-sort lint pre-commit test freeze version build upload docs docs-autobuild docs-coverage reports docs-all

########################################################################################
# Variables
Expand Down Expand Up @@ -50,7 +50,7 @@ dev-%:
# Prepare the development environment.
# Install the pacakge in editable mode with all optional dependencies and pre-commit hoook.
dev:
${PIPRUN} pip install -e .[docs,lint,package,tests] -c constraints/$(or $(SS_CONSTRAINTS_VERSION),default).txt
${PIPRUN} pip install -e .[docs,lint,package,test] -c constraints/$(or $(SS_CONSTRAINTS_VERSION),default).txt
if [ "${CI}" != "true" ] && command -v pre-commit > /dev/null 2>&1; then pre-commit install --hook-type pre-push; fi

########################################################################################
Expand All @@ -59,19 +59,19 @@ dev:

# Check lint with black.
black:
${PIPRUN} python -m black --check docs tests src
${PIPRUN} python -m black --check docs test src

# Check lint with isort.
isort:
${PIPRUN} python -m isort .

# Check lint with mypy.
mypy:
${PIPRUN} python -m mypy docs tests src
${PIPRUN} python -m mypy docs test src

# Check lint with ruff.
ruff:
${PIPRUN} python -m ruff docs tests src
${PIPRUN} python -m ruff docs test src

# Check lint with toml-sort.
toml-sort:
Expand All @@ -85,11 +85,11 @@ lint:
pre-commit run --all-files

########################################################################################
# Tests
# Test
########################################################################################

# Run tests with coverage report.
tests:
# Run test with coverage report.
test:
${PIPRUN} python -m coverage erase
${PIPRUN} python -m coverage run -m pytest
${PIPRUN} python -m coverage report
Expand Down Expand Up @@ -128,7 +128,7 @@ docs-autobuild:

# Generate mypy reports.
docs-mypy:
${PIPRUN} python -m mypy tests src --html-report ${PUBLIC_DIR}/reports/mypy
${PIPRUN} python -m mypy test src --html-report ${PUBLIC_DIR}/reports/mypy

# Generate coverage reports.
docs-coverage:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ A development-focused Python project template with various integrations, configu

[![Serious Scaffold Python](docs/_static/images/logo.svg)](https://github.com/serious-scaffold/serious-scaffold-python)

Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring linters, tests and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/serious-scaffold-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template.
Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring lint, test and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/serious-scaffold-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template.

If you find this helpful, please consider [sponsorship](https://github.com/sponsors/huxuan).

Expand Down
2 changes: 1 addition & 1 deletion README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

[![{{ project_name }}](docs/_static/images/logo.svg)](https://github.com/{{ repo_namespace }}/{{ repo_name }})

Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring linters, tests and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/serious-scaffold-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template.
Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring lint, test and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/serious-scaffold-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template.

If you find this helpful, please consider [sponsorship](https://github.com/sponsors/{{ author_name }}).

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ src = ["src"]
[tool.ruff.per-file-ignores]
"docs/conf.py" = ["INP001"]
"src/\\{\\{ module_name \\}\\}/__init__.py" = ["N999"]
"tests/*" = ["S101"]
"test/*" = ["S101"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
Expand All @@ -107,7 +107,7 @@ dependencies = {file = ["requirements.txt"]}
docs = {file = ["requirements/docs.txt"]}
lint = {file = ["requirements/lint.txt"]}
package = {file = ["requirements/package.txt"]}
tests = {file = ["requirements/tests.txt"]}
test = {file = ["requirements/test.txt"]}

[tool.setuptools_scm]

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ src = ["src"]
[tool.ruff.per-file-ignores]
"docs/conf.py" = ["INP001"]
"src/\\{\\{ module_name \\}\\}/__init__.py" = ["N999"]
"tests/*" = ["S101"]
"test/*" = ["S101"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
Expand All @@ -120,7 +120,7 @@ dependencies = {file = ["requirements.txt"]}
docs = {file = ["requirements/docs.txt"]}
lint = {file = ["requirements/lint.txt"]}
package = {file = ["requirements/package.txt"]}
tests = {file = ["requirements/tests.txt"]}
test = {file = ["requirements/test.txt"]}

[tool.setuptools_scm]

Expand Down
3 changes: 3 additions & 0 deletions requirements/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Requirements for test.
coverage
pytest
3 changes: 0 additions & 3 deletions requirements/tests.txt

This file was deleted.

1 change: 1 addition & 0 deletions test/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Init for the test."""
6 changes: 3 additions & 3 deletions tests/cli_test.py → test/cli_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Tests for cli."""
"""Test for cli."""
from typer.testing import CliRunner

from serious_scaffold.cli import app
Expand All @@ -7,14 +7,14 @@


def test_cli() -> None:
"""Tests for cli."""
"""Test for cli."""
result = runner.invoke(app)
assert result.exit_code == 0
assert "Usage" in result.output


def test_cli_run() -> None:
"""Tests for run subcommand of the cli."""
"""Test for run subcommand of the cli."""
result = runner.invoke(app, "run")
assert result.exit_code == 0
assert not result.output
6 changes: 3 additions & 3 deletions tests/cli_test.py.jinja → test/cli_test.py.jinja
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Tests for cli."""
"""Test for cli."""
from typer.testing import CliRunner

from {{ module_name }}.cli import app
Expand All @@ -7,14 +7,14 @@ runner = CliRunner()


def test_cli() -> None:
"""Tests for cli."""
"""Test for cli."""
result = runner.invoke(app)
assert result.exit_code == 0
assert "Usage" in result.output


def test_cli_run() -> None:
"""Tests for run subcommand of the cli."""
"""Test for run subcommand of the cli."""
result = runner.invoke(app, "run")
assert result.exit_code == 0
assert not result.output
4 changes: 2 additions & 2 deletions tests/pkg_test.py → test/pkg_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Tests for pkg."""
"""Test for pkg."""

import serious_scaffold


def test_pkg() -> None:
"""Tests for pkg."""
"""Test for pkg."""
assert serious_scaffold.__package__ == "serious_scaffold"
4 changes: 2 additions & 2 deletions tests/pkg_test.py.jinja → test/pkg_test.py.jinja
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""Tests for pkg."""
"""Test for pkg."""

import {{ module_name }}


def test_pkg() -> None:
"""Tests for pkg."""
"""Test for pkg."""
assert {{ module_name }}.__package__ == "{{ module_name }}"
4 changes: 2 additions & 2 deletions tests/settings_test.py → test/settings_test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Tests for settings."""
"""Test for settings."""
import os

from serious_scaffold.settings import global_settings, settings


def test_settings() -> None:
"""Tests for settings."""
"""Test for settings."""
assert settings.logging_level == os.getenv(
"SERIOUS_SCAFFOLD_LOGGING_LEVEL",
"INFO",
Expand Down
4 changes: 2 additions & 2 deletions tests/settings_test.py.jinja → test/settings_test.py.jinja
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Tests for settings."""
"""Test for settings."""
import os

from {{ module_name }}.settings import global_settings, settings


def test_settings() -> None:
"""Tests for settings."""
"""Test for settings."""
assert settings.logging_level == os.getenv(
"{{ module_name|upper }}_LOGGING_LEVEL",
"INFO",
Expand Down
1 change: 0 additions & 1 deletion tests/__init__.py

This file was deleted.