-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: update pyproject.toml, ruff, tox, actions, trusted publish
- Loading branch information
1 parent
7d9c247
commit c6e3d98
Showing
33 changed files
with
434 additions
and
415 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Config for Dependabot updates. See Documentation here: | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
# Update GitHub actions in workflows | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
# Check for updates to GitHub Actions every weekday | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: build sdist and wheel | ||
run: pipx run build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: dist/* | ||
|
||
- name: check metadata | ||
run: pipx run twine check dist/* | ||
|
||
publish_dev_build: | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: testpypi | ||
url: https://pypi.org/p/detectree | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: publish to test pypi | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
|
||
release: | ||
needs: [publish_dev_build] | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/detectree | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
# see https://github.com/softprops/action-gh-release/issues/236 | ||
contents: write | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
|
||
- name: update changelog | ||
id: changelog | ||
uses: requarks/changelog-action@v1 | ||
with: | ||
token: ${{ github.token }} | ||
tag: ${{ github.ref_name }} | ||
|
||
- name: create Release | ||
uses: ncipollo/release-action@v1.12.0 | ||
with: | ||
allowUpdates: true | ||
draft: false | ||
makeLatest: true | ||
name: ${{ github.ref_name }} | ||
body: ${{ steps.changelog.outputs.changes }} | ||
token: ${{ github.token }} | ||
|
||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: publish to pypi | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
- name: commit changelog | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
branch: main | ||
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]' | ||
file_pattern: CHANGELOG.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
include: | ||
- os: macos-latest | ||
python-version: "3.12" | ||
- os: windows-latest | ||
python-version: "3.12" | ||
|
||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-name: test-env | ||
create-args: >- | ||
python=${{ matrix.python-version }} | ||
pip | ||
- name: install dependencies | ||
run: pip install tox tox-gh-actions | ||
|
||
- name: test with tox | ||
run: tox | ||
env: | ||
CONDA_EXE: mamba | ||
|
||
- name: upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
|
||
- name: list files | ||
run: ls -l . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,55 @@ | ||
exclude: 'docs|node_modules|migrations|.tox' | ||
default_stages: [commit] | ||
fail_fast: true | ||
ci: | ||
autofix_commit_msg: "style(pre-commit.ci): auto fixes from pre-commit hooks" | ||
autoupdate_commit_msg: "style(pre-commit.ci): pre-commit autoupdate" | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
|
||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.18.2 | ||
- repo: https://github.com/commitizen-tools/commitizen | ||
rev: v3.15.0 | ||
hooks: | ||
- id: check-github-workflows | ||
- id: commitizen | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v3.1.0 | ||
hooks: | ||
- id: prettier | ||
additional_dependencies: [prettier, prettier-plugin-toml, prettier-plugin-ini] | ||
types: ["ini", "toml", "yaml"] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.10.0 | ||
- repo: https://github.com/executablebooks/mdformat | ||
rev: 0.7.17 # Use the ref you want to point at | ||
hooks: | ||
- id: black | ||
- id: mdformat | ||
# Optionally add plugins | ||
additional_dependencies: | ||
- mdformat-gfm | ||
- mdformat-black | ||
|
||
- repo: https://github.com/timothycrosley/isort | ||
rev: 5.10.1 | ||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: v1.35.1 | ||
hooks: | ||
- id: isort | ||
- id: yamllint | ||
args: ["-d relaxed"] | ||
|
||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.28.0 | ||
hooks: | ||
- id: check-github-workflows | ||
|
||
- repo: https://gitlab.com/pycqa/flake8 | ||
rev: 5.0.4 | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.15.0 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [flake8-isort] | ||
- id: pyupgrade | ||
|
||
- repo: https://github.com/pycqa/pydocstyle | ||
rev: 6.1.1 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.2.2 | ||
hooks: | ||
- id: pydocstyle | ||
files: ^detectree | ||
- id: ruff | ||
args: [ --fix ] | ||
- id: ruff-format |
Oops, something went wrong.