Skip to content

Commit fcc42c8

Browse files
committed
coppy update
1 parent 5753ed0 commit fcc42c8

File tree

41 files changed

+641
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+641
-533
lines changed

.circleci/config.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.copier-answers-py.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
1-
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
2-
_commit: v1.20250226.1
1+
# Changes here will be overwritten by Copier
2+
#
3+
# Updating `_src` could be helpful, see notes at:
4+
# https://github.com/level12/coppy/wiki#creating-a-project
5+
#
6+
# Otherwise, NEVER EDIT MANUALLY
7+
_commit: v1.20250622.1-36-g7b1cff7
38
_src_path: gh:level12/copier-py-package
49
author_email: [email protected]
510
author_name: Randy Syring
11+
gh_org: level12
12+
gh_repo: pre-commit-hooks
613
hatch_version_tag_sign: true
714
project_name: pre-commit-hooks
815
py_module: pre_commit_hooks
916
python_version: '3.12'
1017
script_name: check-ruff-versions
18+
use_circleci: false
19+
use_gh_nox: true

.coveragerc

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
# .coveragerc to control coverage.py
22
[run]
33
branch = True
4+
omit =
5+
src/pre_commit_hooks/version.py
46

5-
[report]
6-
# Regexes for lines to exclude from consideration
7-
exclude_lines =
8-
# Have to re-enable the standard pragma
9-
pragma: no cover
7+
source =
8+
src/pre_commit_hooks
9+
tests/pre_commit_hooks_tests
1010

11-
# testing assertions usually used with exceptions
12-
assert False
13-
14-
# patterns for running cli
15-
cli_entry()
1611

1712
[html]
18-
directory = ci/coverage-html
13+
directory = tmp/coverage-html

.editorconfig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ root = true
88

99
# Set the default whitespace settings for all files
1010
[*]
11+
# Sensible modern default
12+
charset = utf-8
1113

1214
# Use UNIX-style line endings
1315
end_of_line = lf
@@ -23,11 +25,6 @@ insert_final_newline = true
2325
trim_trailing_whitespace = true
2426

2527

26-
[*.py]
27-
# ensure Python source files are utf-8
28-
charset = utf-8
29-
30-
3128
[*.{yml,yaml}]
3229
# Set two-space indents for YAML files
3330
indent_size = 2

.github/workflows/nox.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Nox
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
# Limit this workflow to a single run at a time per-branch to avoid wasting worker resources
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
nox:
17+
runs-on: ubuntu-latest
18+
19+
# Runs all steps inside this container
20+
container:
21+
image: ghcr.io/level12/ubuntu-mive:24-3.12
22+
options: --user root
23+
24+
env:
25+
UV_LINK_MODE: copy
26+
27+
steps:
28+
- name: Checkout Code
29+
uses: actions/checkout@v4
30+
31+
- name: Mark repo as safe for Git
32+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
33+
34+
- name: Run Tests
35+
run: |
36+
uv run --frozen --only-group nox -- nox

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v5.0.0
4+
rev: v6.0.0
55
hooks:
66
- id: check-merge-conflict
77
- id: check-ast
@@ -13,7 +13,7 @@ repos:
1313
- id: check-added-large-files
1414
- id: check-yaml
1515
- repo: https://github.com/charliermarsh/ruff-pre-commit
16-
rev: v0.9.7
16+
rev: v0.13.1
1717
hooks:
1818
# i.e. `ruff check`
1919
- id: ruff
@@ -28,3 +28,7 @@ repos:
2828
rev: v0.20250226.1
2929
hooks:
3030
- id: check-ruff-versions
31+
- repo: https://github.com/astral-sh/uv-pre-commit
32+
rev: 0.8.17
33+
hooks:
34+
- id: uv-lock

.python-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

ci/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
artifacts
2+
coverage
23
test-reports

env-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
profile:
22
pypi:
33
HATCH_INDEX_USER: '__token__'
4-
HATCH_INDEX_AUTH: 'op://private/pypi.python.org/api-token'
4+
HATCH_INDEX_AUTH: 'op://my/private/pypi.org/api-token'

mise.toml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
[env]
2-
PROJECT_SLUG = '{{ config_root | basename | slugify }}'
2+
# Will use a centralized venv if `~/.cache/uv-venvs` exists. `.venv` otherwise.
3+
UV_PROJECT_ENVIRONMENT = "{{ exec(command='tasks/mise-uv-init.py proj-env', cache_key='proj-env', cache_duration='1h') | trim }}"
4+
_.python.venv.path = '{{ env.UV_PROJECT_ENVIRONMENT }}'
35

4-
_.python.venv.path = '{% if env.UV_PROJECT_ENVIRONMENT %}{{ env.UV_PROJECT_ENVIRONMENT }}{% else %}.venv{% endif %}'
5-
_.python.venv.create = true
6+
7+
[tools]
8+
python = "{{ exec(command='tasks/mise-uv-init.py py-ver', cache_key='py-ver', cache_duration='1h') | trim }}"
69

710

811
[task_config]
912
includes = [
1013
'tasks',
1114
]
15+
16+
17+
################ TASKS #################
18+
[tasks.pytest-cov]
19+
description = 'Full pytest run with html coverage report'
20+
# .coveragerc sets directory to ./tmp/coverage-html
21+
run = 'pytest --cov --cov-report=html --no-cov-on-fail'
22+
23+
24+
[tasks.upgrade-deps]
25+
description = 'Upgrade uv and pre-commit dependencies'
26+
run = [
27+
'uv sync --upgrade',
28+
'pre-commit autoupdate',
29+
]

0 commit comments

Comments
 (0)