Skip to content

Commit e09001b

Browse files
refactor
1 parent 1cf939d commit e09001b

File tree

131 files changed

+4628
-3573
lines changed

Some content is hidden

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

131 files changed

+4628
-3573
lines changed

.config/.flake8

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

.config/.license_rules

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

.config/requirements-dev.txt

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

.config/requirements.txt

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

.config/requirements_for_safety.txt

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

.github/workflows/build.yml

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,45 @@ name: Build and Test
22

33
on: [ push ]
44

5+
permissions:
6+
contents: read
7+
58
jobs:
69
build:
710
runs-on: ubuntu-latest
811

912
steps:
10-
- uses: actions/checkout@v3
11-
- uses: actions/setup-python@v4
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
with:
15+
persist-credentials: false
16+
17+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
1218
with:
13-
python-version: '3.11'
14-
cache: 'pipenv' # caching pipenv dependencies
15-
- name: Install pipenv and pipx
19+
python-version: '3.13'
20+
21+
- name: Install uv and pipx
1622
run: |
17-
pip install pipenv && pip install pipx
23+
pip install uv && pip install pipx
1824
1925
- name: Install global dependencies
2026
run: |
21-
pipx install isort && pipx install black && pipx install bandit && pipx install pylint && \
22-
pipx install pre-commit && pipx install pygount && pipx install vulture && \
23-
pipx install flake8 && \
24-
pipx inject flake8 dlint mccabe pyflakes pep8-naming flake8-bugbear && \
25-
pipx install "pipenv-to-requirements==0.9.*" && \
26-
pipx inject pipenv-to-requirements "pipenv==2022.9.8" && \
27-
pipx install safety && pipx install pyupgrade && pipx install poetry
27+
pipx install uv && pipx install "coderoller" && \
28+
pipx install isort && pipx install black && pipx install bandit && \
29+
pipx install pylint && pipx install pre-commit && pipx install poetry && pipx install hatch
2830
2931
- name: Install Dependencies
30-
run: pipenv install --dev --skip-lock
32+
run: uv sync
3133

32-
- name: Run nb
33-
run: pipenv run nb package
34+
- name: Run make check
35+
run: chmod +x *.sh && uv run make check
3436

35-
- name: Upload Package
36-
uses: actions/upload-artifact@v3.1.2
37+
- name: Upload coverage reports to Codecov
38+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
3739
with:
38-
name: packages
39-
path: dist/
40-
if-no-files-found: error
41-
retention-days: 1
40+
token: ${{ secrets.CODECOV_TOKEN }}
4241

43-
44-
pypi-publish:
45-
name: Upload release to PyPI
46-
runs-on: ubuntu-latest
47-
environment:
48-
name: pypi
49-
url: https://pypi.org/p/jiggle-version
50-
permissions:
51-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
52-
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
53-
steps:
54-
- name: Get packages
55-
uses: actions/download-artifact@v3.0.2
42+
- name: Upload test results to Codecov
43+
if: ${{ !cancelled() }}
44+
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
5645
with:
57-
name: packages
58-
path: dist/
59-
- name: Publish package distributions to PyPI
60-
uses: pypa/gh-action-pypi-publish@release/v1
61-
needs: build
46+
token: ${{ secrets.CODECOV_TOKEN }}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# .github/workflows/publish-to-pypi.yml
2+
3+
name: Publish jiggle_version to PyPI
4+
5+
on:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
persist-credentials: false
19+
20+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
21+
with:
22+
python-version: '3.13'
23+
24+
- name: Install uv and pipx
25+
run: |
26+
pip install uv && pip install pipx
27+
28+
- name: Install global dependencies
29+
run: |
30+
pipx install uv && pipx install "coderoller" && \
31+
pipx install isort && pipx install black && pipx install bandit && \
32+
pipx install pylint && pipx install pre-commit && pipx install poetry && pipx install hatch
33+
34+
- name: Install Dependencies
35+
run: uv sync
36+
37+
- name: Run make check
38+
run: chmod +x *.sh && uv run make check
39+
40+
- name: Upload coverage reports to Codecov
41+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
42+
with:
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
45+
- name: Run make publish
46+
run: uv run make publish
47+
48+
- name: Upload Package
49+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
50+
with:
51+
name: packages
52+
path: dist/
53+
if-no-files-found: error
54+
retention-days: 1
55+
56+
pypi-publish:
57+
name: Upload release to PyPI
58+
runs-on: ubuntu-latest
59+
environment:
60+
name: pypi
61+
url: https://pypi.org/p/jiggle_version
62+
permissions:
63+
id-token: write
64+
needs: build
65+
steps:
66+
- name: Fail if branch is not main
67+
if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main'
68+
run: |
69+
echo "This workflow should not be triggered with workflow_dispatch on a branch other than main"
70+
exit 1
71+
- name: Check out code
72+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
73+
with:
74+
persist-credentials: false
75+
76+
- name: Download artifact
77+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
78+
with:
79+
name: packages
80+
path: dist/
81+
82+
- name: Publish to PyPI
83+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4

.github/workflows/zizmor.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# https://github.com/woodruffw/zizmor
2+
name: Zizmor
3+
4+
on:
5+
push:
6+
paths:
7+
- .github/**
8+
branches: ["main"]
9+
pull_request:
10+
paths:
11+
- .github/**
12+
branches: ["*"]
13+
14+
permissions:
15+
contents: read
16+
17+
18+
jobs:
19+
zizmor:
20+
name: Zizmor latest via PyPI
21+
runs-on: ubuntu-latest
22+
permissions:
23+
security-events: write
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
with:
28+
persist-credentials: false
29+
- uses: hynek/setup-cached-uv@757bedc3f972eb7227a1aa657651f15a8527c817 # v2.3.0
30+
31+
- name: Run zizmor 🌈
32+
run: uvx zizmor --format sarif . > results.sarif
33+
env:
34+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
36+
- name: Upload SARIF file
37+
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
38+
with:
39+
# Path to SARIF file relative to the root of the repository
40+
sarif_file: results.sarif
41+
# Optional category for the results
42+
# Used to differentiate multiple results for one commit
43+
category: zizmor

0 commit comments

Comments
 (0)