Skip to content

Commit

Permalink
Upgrade CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Nov 15, 2024
1 parent 357cb01 commit 387a2c3
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 39 deletions.
2 changes: 0 additions & 2 deletions .bandit.yaml

This file was deleted.

7 changes: 5 additions & 2 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,29 @@
automerge: true,
},
'pre-commit': { enabled: true },
regexManagers: [
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',
customType: 'regex',
},
/** Do updates on pre-commit additional dependencies */
{
fileMatch: ['^\\.pre\\-commit\\-config\\.yaml$'],
matchStrings: [" +- '?(?<depName>[^' @=]+)(@|==)(?<currentValue>[^' @=]+)'? # (?<datasource>.+)"],
customType: 'regex',
},
/** Python version in actions/setup-python action */
{
fileMatch: ['^\\.github/workflows/.*\\.yaml$'],
matchStrings: [' python-version: [\'"](?<currentValue>[0-9\\.]+)[\'"]'],
datasourceTemplate: 'python-version',
depNameTemplate: 'python',
customType: 'regex',
},
],
packageRules: [
Expand Down Expand Up @@ -64,10 +67,10 @@
},
/** Group Poetry packages */
{
matchPackagePrefixes: ['poetry-'],
groupName: 'Poetry',
automerge: true,
matchDepNames: ['poetry', 'pip'],
matchPackageNames: ['/^poetry\\-.*/'],
},
/** Support the 4 parts of shellcheck-py version with a v prefix */
{
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
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: git diff --exit-code --patch > /tmp/pre-commit.patch; git diff --color; git reset --hard
if: failure()
- run: git diff --patch > /tmp/pre-commit.patch || true
if: failure()
Expand Down Expand Up @@ -78,9 +78,11 @@ jobs:
if: always()

- name: Publish
run: c2cciutils-publish
run: tag-publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: env.HAS_SECRETS == 'HAS_SECRETS'
- run: git diff --exit-code --patch > /tmp/dpkg-versions.patch || true
- run: git diff --exit-code --patch > /tmp/dpkg-versions.patch; git diff --color; git reset --hard
if: failure()
- uses: actions/upload-artifact@v4
with:
Expand Down
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ repos:
additional_dependencies:
- prospector-profile-duplicated==1.6.0 # pypi
- prospector-profile-utils==1.11.1 # pypi
- ruff==0.7.3 # pypi
- repo: https://github.com/camptocamp/jsonschema-gentypes
rev: 2.8.1
hooks:
Expand Down Expand Up @@ -201,3 +202,11 @@ repos:
rev: 38.142.2
hooks:
- id: renovate-config-validator
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
hooks:
- id: ruff-format
- repo: https://github.com/sbrunner/python-versions-hook
rev: 0.7.0
hooks:
- id: python-versions
12 changes: 8 additions & 4 deletions .prospector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ inherits:
- utils:base
- utils:fix
- utils:no-design-checks

doc-warnings: true
- utils:unsafe
- utils:c2cwsgiutils

ignore-paths:
- github_app_geo_project/project_configuration.py
- github_app_geo_project/application_configuration.py

bandit:
mypy:
options:
python-version: '3.10'

ruff:
options:
config: .bandit.yaml
target-version: py310
4 changes: 1 addition & 3 deletions docker-compose.override.sample.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
version: '2.2'

services:
application: &app
application:
command:
- pserve
- --reload
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '2.2'

services:
db:
image: camptocamp/postgres:17-postgis-3
Expand Down
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/1.8.1/jsonschema_gentypes/schema.json

headers: |
"""
Automatically generated file from a JSON schema.
Expand Down
41 changes: 18 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
[tool.black]
line-length = 110
target-version = ["py310"]

[tool.isort]
profile = "black"
line_length = 110
known_first_party = "github_app_geo_project"

[tool.mypy]
python_version = "3.11"
warn_redundant_casts = true
warn_unused_ignores = true
ignore_missing_imports = true
strict = true

[tool.poetry]
name = "github-app-geo-project"
version = "0.0.0"
Expand All @@ -26,13 +10,17 @@ keywords = ["github", "application", "pyramid"]
packages = [{ include = "github_app_geo_project" }]
include = ["github_app_geo_project/py.typed"]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Typing :: Typed",
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Typing :: Typed',
]

[tool.poetry.scripts]
Expand Down Expand Up @@ -96,6 +84,13 @@ types-markdown = "3.7.0.20240822"
types-requests = "2.32.0.20241016"
types-toml = "0.10.8.20240310"

[tool.ruff]
target-version = "py310"
line-length = 110

[tool.ruff.lint.pydocstyle]
convention = "numpy"

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

0 comments on commit 387a2c3

Please sign in to comment.