Skip to content

Commit

Permalink
Update project from its own template via Copier. (v1.6)
Browse files Browse the repository at this point in the history
  • Loading branch information
emcd committed Dec 17, 2024
1 parent 2c5f8cc commit 0e92533
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 21 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.4
_commit: v1.6
_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 .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ trim_trailing_whitespace = true
[*.md]
max_line_length = 79

[*.py,*.py.jinja]
[*.{py,py.jinja}]
max_line_length = 79
insert_final_newline = true

[*.rs,*.rs.jinja]
[*.{rs,rs.jinja}]
max_line_length = 79
insert_final_newline = true

[*.rst,*.rst.jinja]
[*.{rst,rst.jinja}]
indent_size = 2
max_line_length = 79

[*.toml,*.toml.jinja]
[*.{toml,toml.jinja}]
indent_size = 2

[*.yaml]
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.4
uses: emcd/python-project-common/.github/workflows/xrepo--tester.yaml@v1.6
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.4
uses: emcd/python-project-common/.github/workflows/xrepo--reporter.yaml@v1.6
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.4
uses: emcd/python-project-common/.github/workflows/xrepo--documenter.yaml@v1.6
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.4
uses: emcd/python-project-common/.github/workflows/xrepo--packager.yaml@v1.6
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.4
uses: emcd/python-project-common/.github/workflows/xrepo--tester.yaml@v1.6
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.4
uses: emcd/python-project-common/.github/workflows/xrepo--reporter.yaml@v1.6
with:
python-version: '${{ fromJSON(needs.initialize.outputs.python-versions)[0] }}'
2 changes: 2 additions & 0 deletions documentation/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def _import_version( ):
( 'py:class',
"v, remove specified key and return the corresponding value." ),
# Type annotation weirdnesses.
( 'py:class', "Doc" ),
( 'py:class', "types.Annotated" ),
( 'py:class', "typing_extensions.Any" ),
]

Expand Down
4 changes: 2 additions & 2 deletions documentation/sphinx/development/practices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Documentation
or which attempt to provide function docstrings in the style of Google,
NumPy, Sphinx, etc..., will be rejected.

.. todo:: Rust Documentation


* Use long option names, whenever possible, in command line examples. Readers,
who are unfamiliar with a command, should not have to look up the meanings of
Expand All @@ -51,7 +51,7 @@ Exceptional Conditions
``from`` original exception or raise a new exception with original exception
as the ``__context__``. Or properly handle the exception.

.. todo:: Rust Panics


Imports
===============================================================================
Expand Down
73 changes: 73 additions & 0 deletions documentation/sphinx/development/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,76 @@ Postrelease Patch

10. Cherry-pick patch and Towncrier commits back to ``master`` branch,
resolving conflicts as necessary.

Changelog Entries
===============================================================================

The project uses `Towncrier <https://towncrier.readthedocs.io/>`_ to manage its
changelog. When making changes that should be noted in the changelog, add a
file ("fragment") to the ``documentation/towncrier`` directory with of
``<issue_number>.<type>.rst``, for changes with a Github issue, or
``+<title>.<type>.rst``, for changes without an associated issue number.

The entries will be collected and organized when a release is made, as
described in the release process sections above.

Available Types
-------------------------------------------------------------------------------

* ``bugfix``: For bug fixes
* ``docs``: For documentation improvements
* ``feature``: For new features
* ``platform``: For changes to supported platforms
* ``removal``: For deprecations and removals

Format
-------------------------------------------------------------------------------

The file should contain a concise description of the change written in present
tense. For example:

.. code-block:: rst
:caption: documentation/towncrier/+immutable-modules.feature.rst
Add support for immutable module reclassification.
The description should:

* Start with a capital letter
* End with a period
* Use present tense (e.g., "Add", "Fix", "Update")
* Focus on the what and why, not the how
* Be understandable by users, not just developers

Examples
-------------------------------------------------------------------------------

Bug Fix:
.. code-block:: rst
:caption: documentation/towncrier/456.bugfix.rst
Fix attribute visibility in immutable modules.
Documentation:
.. code-block:: rst
:caption: documentation/towncrier/457.docs.rst
Improve release process documentation with Towncrier details.
Feature:
.. code-block:: rst
:caption: documentation/towncrier/458.feature.rst
Add recursive module reclassification support.
Platform:
.. code-block:: rst
:caption: documentation/towncrier/459.platform.rst
Add support for Python 3.13.
Removal:
.. code-block:: rst
:caption: documentation/towncrier/460.removal.rst
Remove deprecated ``make_immutable`` function.
7 changes: 3 additions & 4 deletions documentation/sphinx/development/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Code Style
style other than the project code style, will be rejected.


.. todo:: Rust Guidance



Specific Preferences
Expand Down Expand Up @@ -186,9 +186,8 @@ the last element unless the collection has a trailing comma::
if is_valid( value ) ]

# Multi-line conditional statements
if (
validate_input( data, strict = True )
and process_ready( )
if ( validate_input( data, strict = True )
and process_ready( )
): process( data )


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ disable = [
]
# TODO: Latest 'per-file-ignores' code may supports dicts and lists in addition to strings.
per-file-ignores = '''
/tests/:attribute-defined-outside-init,magic-value-comparison,missing-class-docstring,missing-function-docstring,protected-access,unexpected-keyword-arg
/tests/:attribute-defined-outside-init,comparison-with-itself,magic-value-comparison,missing-class-docstring,missing-function-docstring,protected-access,singleton-comparison,superfluous-parens,unexpected-keyword-arg
__init__\.py:unused-import
''' # Note: Paths are regexes.
[tool.pylint.refactoring]
Expand Down
2 changes: 1 addition & 1 deletion sources/emcd_projects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from . import exceptions


__version__ = '1.0a0'
__version__ = '1.7a0'


# TODO: Reclassify package modules as immutable and concealed.
7 changes: 5 additions & 2 deletions sources/emcd_projects/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
'''


from . import __


class Omniexception( BaseException ):
''' Base for all exceptions raised by package API. '''
# TODO: Class and instance attribute immutability.
# TODO: Class and instance attribute concealment and immutability.

_attribute_visibility_includes_: frozenset[ str ] = (
_attribute_visibility_includes_: __.cabc.Collection[ str ] = (
frozenset( ( '__cause__', '__context__', ) ) )


Expand Down

0 comments on commit 0e92533

Please sign in to comment.