Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI updates #2768

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
10 changes: 10 additions & 0 deletions .github/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/camptocamp/tag-publish/0.13.3/tag_publish/schema.json

docker:
images:
- name: camptocamp/tilecloud-chain
pypi:
packages:
- {}
dispatch:
- {}
97 changes: 22 additions & 75 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,51 +1,33 @@
{
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,
lockFileMaintenance: {
enabled: true,
automerge: true,
schedule: 'after 5pm on the first day of the month',
},
extends: [
'github>camptocamp/gs-renovate-config-preset:base.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:group.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:stabilization-branches.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:ci.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:preset.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:pre-commit.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:python.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:security.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:docker.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:own.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:json-schema.json5#0.8.1',
'github>camptocamp/gs-renovate-config-preset:shellcheck.json5#0.8.1',
],
baseBranches: ['1.17', '1.19', '1.20', '1.21', '1.22', 'master'],
'pre-commit': { enabled: true },
regexManagers: [
/** Do updates on pre-commit additional dependencies */
{
fileMatch: ['^\\.pre\\-commit\\-config\\.yaml$'],
matchStrings: [" +- '?(?<depName>[^' @=]+)(@|==)(?<currentValue>[^' @=]+)'? # (?<datasource>.+)"],
},
/** 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',
},
customManagers: [
/** Manage unpkg */
{
fileMatch: ['.*\\.html$'],
matchStrings: ['unpkg\\.com/(?<depName>[^@]+)@(?<currentValue>[^/]+)'],
datasourceTemplate: 'npm',
customType: 'regex',
},
/** Manage jsdelivr */
{
fileMatch: ['.*\\.html$'],
matchStrings: ['cdn\\.jsdelivr\\.net/npm/(?<depName>[^@]+)@(?<currentValue>[^/]+)'],
datasourceTemplate: 'npm',
},
/** Python version in actions/setup-python action */
{
fileMatch: ['^\\.github/workflows/(main|pull-request-automation)\\.yaml$'],
matchStrings: [' python-version: [\'"](?<currentValue>[0-9\\.]+)[\'"]'],
datasourceTemplate: 'python-version',
depNameTemplate: 'python',
customType: 'regex',
},
],
packageRules: [
Expand Down Expand Up @@ -74,30 +56,6 @@
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: 'Poetry',
automerge: true,
matchDepNames: ['poetry', 'pip'],
},
/** Accept only the patch on stabilization branches */
{
matchBaseBranches: ['/^[0-9]+\\.[0-9]+$/'],
Expand All @@ -122,17 +80,6 @@
matchBaseBranches: ['1.17', '1.18', '1.19', '1.20', '1.21'],
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'],
},
/** Group and auto merge the CI dependencies */
{
matchFileNames: ['.github/**', '.pre-commit-config.yaml', 'ci/**'],
groupName: 'CI dependencies',
automerge: true,
},
/** Automatically update all versions of cryptography to fic CVE */
{
matchDepNames: ['cryptography'],
Expand All @@ -145,15 +92,15 @@
matchBaseBranches: ['/^[0-9]+\\.[0-9]+$/'],
minimumReleaseAge: '7 days',
},
/** Ungroup Python dependencies */
{
matchDepNames: ['python'],
groupName: 'Python',
},
/** Ungroup Gdal */
{
matchDepNames: ['ghcr.io/osgeo/gdal'],
groupName: 'Gdal',
},
/** In file `.python-version`, use the `<major>.<minor>` version */
{
matchFileNames: ['.python-version'],
versioning: 'regex:^(?<major>\\d+)\\.(?<minor>\\d+)$',
},
],
}
14 changes: 10 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,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 && git reset --hard
- 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 Expand Up @@ -82,13 +82,19 @@ jobs:

- run: git reset --hard
- name: Publish
run: c2cciutils-publish
run: tag-publish
if: env.HAS_SECRETS == 'HAS_SECRETS'
- run: git diff --exit-code --patch > /tmp/dpkg-versions.patch || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: git diff --exit-code --patch > /tmp/dpkg-versions.patch; git diff --color; git reset --hard || true
if: failure()
- uses: actions/upload-artifact@v4
with:
name: Update dpkg versions list.patch
path: /tmp/dpkg-versions.patch
retention-days: 1
if: failure()
permissions:
contents: write
packages: write
id-token: write
1 change: 0 additions & 1 deletion .github/workflows/pull-request-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
types:
- opened
- reopened

jobs:
auto-merge:
name: Auto reviews pull requests from bots
Expand Down
21 changes: 15 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ repos:
- tilecloud_chain/host-limit-schema.json
- tilecloud_chain/HOST_LIMIT.md
- repo: https://github.com/sbrunner/hooks
rev: 1.2.1
rev: 1.3.0
hooks:
- id: copyright
- id: poetry-lock
- id: poetry2-lock
additional_dependencies:
- poetry==2.0.1 # pypi
- id: canonicalize
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
Expand Down Expand Up @@ -104,9 +105,6 @@ repos:
args:
- --builtin-schema
- github-workflows-require-timeout
- id: check-renovate
additional_dependencies:
- pyjson5==1.6.8 # pypi
- repo: https://github.com/sirwart/ripsecrets
rev: v0.1.8
hooks:
Expand All @@ -123,6 +121,8 @@ repos:
- --tool=ruff
- --die-on-tool-error
- --output-format=pylint
- --profile=.prospector.yaml
- --profile=utils:autofix
exclude: |
(?x)^(
tilecloud_chain/tests/.*
Expand All @@ -131,11 +131,20 @@ repos:
- prospector-profile-duplicated==1.10.4 # pypi
- prospector-profile-utils==1.17.0 # pypi
- ruff==0.9.4 # pypi
- id: prospector
args:
- --die-on-tool-error
- --output-format=pylint
- --profile=utils:tests
- --profile=utils:autofix
additional_dependencies:
- prospector-profile-utils==1.20.2 # pypi
- ruff==0.9.6 # pypi
- repo: https://github.com/sbrunner/jsonschema-validator
rev: 1.0.0
hooks:
- id: jsonschema-validator
files: ^ci/config\.yaml$
files: ^\.github/publish\.yaml$
- repo: https://github.com/renovatebot/pre-commit-hooks
rev: 39.157.0
hooks:
Expand Down
1 change: 0 additions & 1 deletion .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ inherits:
- utils:base
- utils:no-design-checks
- utils:fix
- utils:unsafe
- utils:c2cwsgiutils
- duplicated

Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.14.0a4-windowsservercore-ltsc2025
3.12
14 changes: 0 additions & 14 deletions .whitesource

This file was deleted.

10 changes: 0 additions & 10 deletions ci/config.yaml

This file was deleted.

3 changes: 2 additions & 1 deletion ci/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
c2cciutils[checks,publish]==1.7.3
c2cciutils==1.7.3
poetry-dynamic-versioning==1.7.1
poetry-plugin-export==1.9.0
poetry-plugin-tweak-dependencies-version==1.5.2
pre-commit==4.1.0
poetry-plugin-drop-python-upper-constraint==0.1.0
importlib-metadata<8.6.2
tag-publish==0.13.3
2 changes: 2 additions & 0 deletions jsonschema-gentypes.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# 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.
Expand Down
24 changes: 8 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
[tool.black]
line-length = 110
target-version = ["py310"]

[tool.isort]
profile = "black"
line_length = 110
known_first_party = "tilecloud"
known_third_party = "c2cwsgiutils"

[tool.ruff]
line-length = 110
target-version = "py310"
Expand Down Expand Up @@ -92,17 +82,15 @@ coverage = "7.6.10"
types-redis = "4.6.0.20241004"
types-requests = "2.32.0.20241016"

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning", "poetry-plugin-tweak-dependencies-version", "poetry-plugin-drop-python-upper-constraint"]
build-backend = "poetry.core.masonry.api"

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
pattern = "^(?P<base>\\d+(\\.\\d+)*)"
format-jinja = """
{%- if env.get("VERSION_TYPE") == "version_branch" -%}
{{serialize_pep440(bump_version(base, 1 if env.get("IS_MASTER") == "TRUE" else 2), dev=distance)}}
{%- if env.get("VERSION_TYPE") == "default_branch" -%}
{{serialize_pep440(bump_version(base, 1), dev=distance)}}
{%- elif env.get("VERSION_TYPE") == "stabilization_branch" -%}
{{serialize_pep440(bump_version(base, 2), dev=distance)}}
{%- elif distance == 0 -%}
{{serialize_pep440(base)}}
{%- else -%}
Expand All @@ -112,3 +100,7 @@ format-jinja = """

[tool.poetry-plugin-tweak-dependencies-version]
default = "present"

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning", "poetry-plugin-tweak-dependencies-version", "poetry-plugin-drop-python-upper-constraint"]
build-backend = "poetry.core.masonry.api"
4 changes: 3 additions & 1 deletion tilecloud_chain/configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Automatically generated file from a JSON schema."""
"""
Automatically generated file from a JSON schema.
"""

from typing import Any, Literal, TypedDict, Union

Expand Down
4 changes: 3 additions & 1 deletion tilecloud_chain/host_limit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Automatically generated file from a JSON schema."""
"""
Automatically generated file from a JSON schema.
"""

from typing import TypedDict

Expand Down
Loading