Skip to content

Commit

Permalink
build: copier and poetry updates (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleKing committed Apr 18, 2024
1 parent aa69edd commit 41c7fba
Show file tree
Hide file tree
Showing 13 changed files with 1,247 additions and 1,332 deletions.
668 changes: 306 additions & 362 deletions .calcipy_packaging.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Answer file maintained by Copier for: https://github.com/KyleKing/calcipy_template
# DO NOT MODIFY THIS FILE. Edit by re-running copier and changing responses to the questions
# Check into version control.
_commit: 1.9.6
_commit: 1.9.14
_src_path: gh:KyleKing/calcipy_template
author_email: [email protected]
author_name: Kyle King
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
shell: bash

- name: Setup Python ${{ inputs.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: poetry
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ jobs:
# Based on: https://github.com/jakebailey/pyright-action/issues/10#issuecomment-1455220629
- name: Add Poetry Python to Path
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v1
- uses: jakebailey/pyright-action@v2
2 changes: 1 addition & 1 deletion .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
uses: ts-graphviz/setup-graphviz@v2

# https://github.com/mkdocs/mkdocs/discussions/2369#discussioncomment-625475
- name: Configure git user
Expand Down
22 changes: 8 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,47 +42,41 @@ repos:
- id: trailing-whitespace
exclude: __snapshots__/.*\.ambr
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.13.0
rev: v3.20.0
hooks:
- id: commitizen
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies: ["mdformat-mkdocs[recommended]>=1.0.6"]
additional_dependencies:
- "mdformat-mkdocs[recommended]>=2.0.6"
args: [--wrap=no]
exclude: _.+\.md|CHANGELOG\.md|CODE_TAG_SUMMARY\.md
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
rev: v0.10.0.1
hooks:
- id: shellcheck
args: [--severity=warning]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v4.0.0-alpha.4"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
additional_dependencies:
# Note: this version must be the same as the hook revision
- "[email protected].4"
- "[email protected].8"
- "prettier-plugin-sh"
exclude: \.copier-answers\.yml|tests/.*/cassettes/.*\.yaml
types_or: [html, javascript, json, shell, yaml]
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.33.0
rev: v1.35.1
hooks:
- id: yamllint
exclude: tests/.*/cassettes/.*\.yaml
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
args:
[
--in-place,
--all,
--trailing-comma-inline-array,
--sort-first=python,
]
# Don't remove comments and sort order from test files
exclude: poetry\.lock|config_default.toml|demo_config.toml
- repo: https://github.com/MarcoGorelli/absolufy-imports
Expand All @@ -92,7 +86,7 @@ repos:
args: [--never]
files: tail_jsonl/.*\.py
- repo: https://github.com/KyleKing/calcipy
rev: 2.0.3
rev: 2.0.4
hooks:
- id: copier-forbidden-files
- id: lint-fix
Expand Down
17 changes: 10 additions & 7 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Docs: https://github.com/charliermarsh/ruff
# Tip: poetry run python -m ruff --explain RUF100

line-length = 120
target-version = 'py39'

[lint]
external = [
'CAC001', # <func> is too complex (8 > 7)
'ECE001', # Expression is too complex (8 > 7)
Expand Down Expand Up @@ -32,18 +36,16 @@ ignore = [
'TID252', # Relative imports from parent modules are banned
'TRY003', # Avoid specifying long messages outside the exception class
]
line-length = 120
preview = true
select = ['ALL']
target-version = 'py39'
unfixable = [
'ERA001', # Commented out code
]

[flake8-quotes]
[lint.flake8-quotes]
inline-quotes = 'single'

[flake8-tidy-imports.banned-api]
[lint.flake8-tidy-imports.banned-api]
'invoke.collection.Collection'.msg = 'Use calcipy.cli.Collection instead.'
'invoke.tasks.task'.msg = 'Use calcipy.cli.task instead.'
'typing.Callable'.msg = 'Use beartype.typing.* instead.'
Expand All @@ -53,10 +55,10 @@ inline-quotes = 'single'
'typing.Protocol'.msg = 'Use beartype.typing.* instead.'
'typing.TypeVar'.msg = 'Use beartype.typing.* instead.'

[isort]
[lint.isort]
known-first-party = ['tail_jsonl']

[per-file-ignores]
[lint.per-file-ignores]
'./tail_jsonl/../*.py' = [
'INP001', # File `/<>.py` is part of an implicit namespace package. Add an `__init__.py`.
]
Expand All @@ -77,9 +79,10 @@ known-first-party = ['tail_jsonl']
'D100', # Missing docstring in public module
'D103', # Missing docstring in public function
'EM102', # Exception must not use an f-string literal, assign to variable first
'PLC2701', # Private name import `_<>` from external module
'PT004', # flake8-pytest-style: fixture does not return
'S101', # Use of `assert` detected
]

[pylint]
[lint.pylint]
max-args = 6
3 changes: 3 additions & 0 deletions docs/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@

- migrate to corallium's rich_printer and styles


- begin migration to corallium and calcipy v1 with copier template

## 1.1.2 (2023-02-16)

### Fix
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ poetry config pypi-token.pypi ...
| `tail_jsonl/scripts.py` | 18 | 0 | 11 | 90.9% |
| **Totals** | 95 | 1 | 28 | 94.5% |

Generated on: 2023-10-14
Generated on: 2024-04-18
<!-- {cte} -->
84 changes: 42 additions & 42 deletions docs/docs/STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,51 @@ We use [Commitizen](https://github.com/commitizen-tools/commitizen) to manage bo
> `type(scope): description`
- **Types**
- *fix*: A bug fix
- *feat*: A new feature
- *docs*: Documentation-only changes (code comments, separate docs)
- *style*: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons)
- *perf*: A code change that improves performance
- *refactor*: A change to production code that is not a *fix*, *feat*, or *perf*
- *test*: Adding missing or correcting existing tests
- *build*: Changes that affect the build system or external dependencies
- *ci*: Changes to our CI configuration files and scripts
- A `!` can be used to indicate a breaking change (`refactor!: drop support for Node 6`)
- **SemVer Rules**
- Based on commit type, the version will be auto-incremented: `fix : PATCH // feat : MINOR // BREAKING CHANGE : MAJOR`
- *fix*: A bug fix
- *feat*: A new feature
- *docs*: Documentation-only changes (code comments, separate docs)
- *style*: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons)
- *perf*: A code change that improves performance
- *refactor*: A change to production code that is not a *fix*, *feat*, or *perf*
- *test*: Adding missing or correcting existing tests
- *build*: Changes that affect the build system or external dependencies
- *ci*: Changes to our CI configuration files and scripts
- A `!` can be used to indicate a breaking change (`refactor!: drop support for Node 6`)
- **SemVer Rules**
- Based on commit type, the version will be auto-incremented: `fix : PATCH // feat : MINOR // BREAKING CHANGE : MAJOR`
- **Scopes**
- A Class, File name, Issue Number, other appropriate noun. As examples: `build(poetry): bump requests to v3` or `style(#32): add missing type annotations`
- A Class, File name, Issue Number, other appropriate noun. As examples: `build(poetry): bump requests to v3` or `style(#32): add missing type annotations`
- **Tips**
- What if a commit fits multiple types?
- Go back and make multiple commits whenever possible. Part of the benefit of Conventional Commits is the focus on more organized and intentional changes
- Use `git rebase -i` to fix commit names prior to merging if incorrect types/scopes are used
- What if a commit fits multiple types?
- Go back and make multiple commits whenever possible. Part of the benefit of Conventional Commits is the focus on more organized and intentional changes
- Use `git rebase -i` to fix commit names prior to merging if incorrect types/scopes are used

### Git Description Guidelines

- [Commit message guidelines](https://writingfordevelopers.substack.com/p/how-to-write-a-commit-message)
- Full sentence with verb (*lowercase*) and concise description. Below are modified examples for Conventional Commits
- `fix(roles): bug in admin role permissions`
- `feat(ui): implement new button design`
- `build(pip): upgrade package to remove vulnerabilities`
- `refactor: file structure to improve code readability`
- `perf(cli): rewrite methods`
- `feat(api): endpoints to implement new customer dashboard`
- Full sentence with verb (*lowercase*) and concise description. Below are modified examples for Conventional Commits
- `fix(roles): bug in admin role permissions`
- `feat(ui): implement new button design`
- `build(pip): upgrade package to remove vulnerabilities`
- `refactor: file structure to improve code readability`
- `perf(cli): rewrite methods`
- `feat(api): endpoints to implement new customer dashboard`
- [How to write a good commit message](https://chris.beams.io/posts/git-commit/)
- A diff will tell you what changed, but only the commit message can properly tell you why.
- Keep in mind: [This](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) [has](https://www.git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines) [all](https://github.com/torvalds/subsurface-for-dirk/blob/master/README.md#contributing) [been](http://who-t.blogspot.co.at/2009/12/on-commit-messages.html) [said](https://github.com/erlang/otp/wiki/writing-good-commit-messages) [before](https://github.com/spring-projects/spring-framework/blob/30bce7/CONTRIBUTING.md#format-commit-messages).
- From the seven rules of a great Git commit message:
- 2. [Try for 50 characters, but consider 72 the hard limit](https://chris.beams.io/posts/git-commit/#limit-50)
- 7. [Use the body to explain what and why vs. how](https://chris.beams.io/posts/git-commit/#why-not-how)
- A diff will tell you what changed, but only the commit message can properly tell you why.
- Keep in mind: [This](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) [has](https://www.git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines) [all](https://github.com/torvalds/subsurface-for-dirk/blob/master/README.md#contributing) [been](http://who-t.blogspot.co.at/2009/12/on-commit-messages.html) [said](https://github.com/erlang/otp/wiki/writing-good-commit-messages) [before](https://github.com/spring-projects/spring-framework/blob/30bce7/CONTRIBUTING.md#format-commit-messages).
- From the seven rules of a great Git commit message:
- (2) [Try for 50 characters, but consider 72 the hard limit](https://chris.beams.io/posts/git-commit/#limit-50)
- (7) [Use the body to explain what and why vs. how](https://chris.beams.io/posts/git-commit/#why-not-how)

### Issue Labels and Milestones

Personal Guide

- For Issue Labels, see [labels.yml][labels]
- For Issue Labels, see \[labels.yml\]\[labels\]
- Milestones
- **Current Tasks**: main milestone (*name could change based on a specific project, sprint, or month*)
- **Next Tasks**
- **Blue Sky**
- **Current Tasks**: main milestone (*name could change based on a specific project, sprint, or month*)
- **Next Tasks**
- **Blue Sky**

<details>
<summary>Research</summary>
Expand Down Expand Up @@ -127,25 +127,25 @@ Personal Guide

<!-- Revisit -->

- [Git: The Simple Guide][simple_git]
- [Commit Messages][gcmsg] and [why use the present tense](https://news.ycombinator.com/item?id=8874177)
- \[Git: The Simple Guide\]\[simple_git\]
- \[Commit Messages\]\[gcmsg\] and [why use the present tense](https://news.ycombinator.com/item?id=8874177)
- [GitHub's Advice on GitHub](https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
- [Most Comprehensive Guide](https://chris.beams.io/posts/git-commit/)
- [Git Pro Book (free)](https://git-scm.com/book/en/v2)
- [Bash Tab-Completion Snippet](https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash)
- [Bash Tab-Completion Snippet](https://git-scm.com/book/en/v2/Appendix-A%3A-Git-in-Other-Environments-Git-in-Bash)

## Python

<!-- Revisit -->

- Python Style Guides
- <https://gist.github.com/sloria/7001839>
- <http://www.nilunder.com/blog/2013/08/03/pythonic-sensibilities/>
- <https://innoq.github.io/cards42org_en/>
- <https://docs.openstack.org/hacking/latest/user/hacking.html#styleguide>
- <https://www.python.org/doc/humor/>
- <https://docs.python-guide.org/writing/reading/>
- <https://realpython.com/python-refactoring/>
- <https://gist.github.com/sloria/7001839>
- <http://www.nilunder.com/blog/2013/08/03/pythonic-sensibilities/>
- <https://innoq.github.io/cards42org_en/>
- <https://docs.openstack.org/hacking/latest/user/hacking.html#styleguide>
- <https://www.python.org/doc/humor/>
- <https://docs.python-guide.org/writing/reading/>
- <https://realpython.com/python-refactoring/>

## ADRs

Expand Down
Loading

0 comments on commit 41c7fba

Please sign in to comment.