Skip to content

Commit

Permalink
Fix, upgrade CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jan 9, 2025
1 parent 0bb9e30 commit 725508d
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 201 deletions.
4 changes: 0 additions & 4 deletions .bandit.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/tag-publish/0.7.1/tag_publish/schema.json
# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/tag-publish/0.13.3/tag_publish/schema.json

pypi:
versions:
versions_type:
- tag
- stabilization_branch
- default_branch
Expand Down
100 changes: 13 additions & 87 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,102 +1,28 @@
{
extends: ['config:base'],
timezone: 'Europe/Zurich',
schedule: 'after 5pm on the first day of the month',
labels: ['dependencies'],
separateMajorMinor: true,
separateMinorPatch: true,
prHourlyLimit: 0,
prConcurrentLimit: 0,
baseBranches: ['master'],
'pre-commit': { enabled: true },
lockFileMaintenance: {
enabled: true,
automerge: true,
schedule: 'after 5pm on the first day of the month',
},
regexManagers: [
/** Do updates on pre-commit additional dependencies */
{
fileMatch: ['^\\.pre\\-commit\\-config\\.yaml$'],
matchStrings: [" +- '?(?<depName>[^' @=]+)(@|==)(?<currentValue>[^' @=]+)'? # (?<datasource>.+)"],
},
extends: [
'config:base',
'github>camptocamp/gs-renovate-config-preset:base.json5#0.3.3',
'github>camptocamp/gs-renovate-config-preset:ci.json5#0.3.3',
'github>camptocamp/gs-renovate-config-preset:pre-commit.json5#0.3.3',
'github>camptocamp/gs-renovate-config-preset:python.json5#0.3.3',
'github>camptocamp/gs-renovate-config-preset:json-schema.json5#0.3.3',
'github>camptocamp/gs-renovate-config-preset:shellcheck.json5#0.3.3',
],
minimumReleaseAge: '7 days',
customManagers: [
/** Do update on the schema present in the ci/config.yaml */
{
fileMatch: ['^ci/config\\.yaml$'],
matchStrings: [
'.*https://raw\\.githubusercontent\\.com/(?<depName>[^\\s]+)/(?<currentValue>[0-9\\.]+)/.*',
],
datasourceTemplate: 'github-tags',
},
/** Python version in actions/setup-python action */
{
fileMatch: ['^\\.github/workflows/.*\\.yaml$'],
matchStrings: [' python-version: [\'"](?<currentValue>[0-9\\.]+)[\'"]'],
datasourceTemplate: 'python-version',
depNameTemplate: 'python',
customType: 'regex',
},
{
fileMatch: ['^tag_publish/versions.yaml$'],
matchStrings: ['(?<depName>.*): (?<currentValue>.*) # (?<datasource>.*)'],
},
],
packageRules: [
/** Automerge the patch, the minor and the dev dependency */
{
matchBaseBranches: ['master'],
matchUpdateTypes: ['minor', 'patch'],
automerge: true,
},
/** Auto merge the dev dependency update */
{
matchDepTypes: ['devDependencies'],
automerge: true,
},
/** Group and auto merge the patch updates */
{
matchUpdateTypes: ['patch'],
groupName: 'all patch versions',
automerge: true,
},
/** Group and auto merge the minor updates */
{
matchUpdateTypes: ['minor'],
groupName: 'all minor versions',
automerge: true,
},
/** Group Poetry packages */
{
matchPackagePrefixes: ['poetry'],
groupName: 'CI/build dependencies',
automerge: true,
},
/** Group and auto merge the CI dependencies */
{
matchFileNames: ['.github/**', '.pre-commit-config.yaml', 'ci/**'],
groupName: 'CI/build dependencies',
automerge: true,
},
/** Accept only the patch on stabilization branches */
{
matchBaseBranches: ['/^[0-9]+\\.[0-9]+$/'],
matchUpdateTypes: ['major', 'minor', 'pin', 'digest', 'lockFileMaintenance', 'rollback', 'bump'],
enabled: false,
},
/** Support the 4 parts of shellcheck-py version with a v prefix */
{
versioning: 'regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)\\.(?<build>\\d+)$',
matchDepNames: ['shellcheck-py/shellcheck-py'],
},
/** Disable upgrading the supported Python version */
{
matchFileNames: ['pyproject.toml'],
enabled: false,
matchDepNames: ['python'],
},
/** Packages published very recently are not pushed to stabilization branches for security reasons */
{
matchBaseBranches: ['/^[0-9]+\\.[0-9]+$/'],
minimumReleaseAge: '7 days',
customType: 'regex',
},
],
}
22 changes: 0 additions & 22 deletions .github/workflows/backport.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions .github/workflows/clean.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: "pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}\npre-commit-"
- run: pre-commit run --all-files
- run: git diff --exit-code --patch > /tmp/pre-commit.patch || true
- run: pre-commit run --all-files --color=always
- run: git diff --exit-code --patch > /tmp/pre-commit.patch; git diff --color; git reset --hard || true
if: failure()
- uses: actions/upload-artifact@v4
with:
Expand Down
14 changes: 10 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ repos:
- id: jsonschema-validator
files: |-
(?x)^(
ci/config\.yaml
\.github/ghci\.yaml
|\.github/publish\.yaml
)$
- repo: https://github.com/sbrunner/jsonschema2md2
rev: 1.3.0
Expand Down Expand Up @@ -101,12 +102,13 @@ repos:
hooks:
- id: prospector
args:
- --tool=pydocstyle
- --tool=ruff
- --die-on-tool-error
- --output-format=pylint
additional_dependencies:
- prospector-profile-duplicated==1.8.1 # pypi
- prospector-profile-utils==1.12.2 # pypi
- prospector-profile-duplicated==1.10.4 # pypi
- prospector-profile-utils==1.15.1 # pypi
- ruff==0.7.3 # pypi
- repo: https://github.com/mheap/json-schema-spell-checker
rev: main
hooks:
Expand All @@ -121,3 +123,7 @@ repos:
- --ignore-numbers
- --ignore-acronyms
- --en-us
- repo: https://github.com/sbrunner/python-versions-hook
rev: 0.8.0
hooks:
- id: python-versions
16 changes: 9 additions & 7 deletions .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ inherits:
- utils:base
- utils:no-design-checks
- utils:fix
- utils:unsafe
- duplicated

doc-warnings: true

ignore-paths:
- tag_publish/configuration.py

pylint:
disable:
- missing-module-docstring
mypy:
options:
python-version: '3.9'

bandit:
ruff:
options:
config: .bandit.yaml
target-version: py39
disable:
- S607 # Starting a process with a partial executable path [See: https://docs.astral.sh/ruff/rules/start-process-with-partial-path]
- S603 # `subprocess` call: check for execution of untrusted input [See: https://docs.astral.sh/ruff/rules/subprocess-without-shell-equals-true]
4 changes: 4 additions & 0 deletions jsonschema-gentypes.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/sbrunner/jsonschema-gentypes/2.9.3/jsonschema_gentypes/schema.json

headers: |
"""
Automatically generated file from a JSON schema.
"""
python_version: '3.9'

pre_commit:
enabled: true
hooks_skip:
Expand Down
27 changes: 27 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 18 additions & 37 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,8 @@
line-length = 110
target-version = "py39"

[tool.ruff.lint]
fixable = ["ALL"]
extend-select = [
"UP", # pyupgrade
"F", # Pyflakes
"E", "W", # Pycodestyle
"I", # isort
"S", # flake8-bandit
"SIM", # flake8-simplify
"B", # flake8-bugbear
# pydocstyle
"D213", "D214", "D215", "D405", "D406", "D407", "D408", "D409", "D410", "D411", "D413", "D416", "D417",
]
ignore= [
"S101", # Use of assert detected
"S607", # start-process-with-partial-path
"S603", # subprocess-without-shell-equals-true
]
exclude = ["tag_publish/configuration.py"]

[tool.mypy]
python_version = "3.9"
ignore_missing_imports = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
strict = true
[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.poetry]
name = "tag-publish"
Expand All @@ -41,13 +16,19 @@ repository = "https://github.com/camptocamp/tag-publish"
license = "FreeBSD"
packages = [{ include = "tag_publish" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Typing :: Typed",
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Typing :: Typed',
]
include = [
"tag_publish/py.typed",
Expand All @@ -73,9 +54,9 @@ debian-inspector = "31.1.0"
multi-repo-automation = "1.5.0"

[tool.poetry.group.dev.dependencies]
prospector = { version = "1.13.3", extras = ["with-bandit", "with-mypy", "with-pyroma"] }
prospector-profile-duplicated = "1.10.0"
prospector-profile-utils = "1.14.1"
prospector = { version = "1.13.3", extras = ["with_bandit", "with_mypy", "with_pyroma", "with_ruff"] }
prospector-profile-duplicated = "1.10.4"
prospector-profile-utils = "1.15.1"
types-requests = "2.32.0.20241016"
types-pyyaml = "6.0.12.20241230"

Expand Down
Loading

0 comments on commit 725508d

Please sign in to comment.