Skip to content

Commit

Permalink
Update all minor versions (master) (minor) (#1186)
Browse files Browse the repository at this point in the history
* Update all minor versions

* Add Ruff

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Stéphane Brunner <[email protected]>
  • Loading branch information
renovate[bot] and sbrunner authored Dec 3, 2024
1 parent 975972d commit 12ce4a2
Show file tree
Hide file tree
Showing 37 changed files with 215 additions and 144 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ 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
env:
SKIP: poetry-lock,isort
- run: git diff --exit-code --patch > /tmp/pre-commit.patch || true
if: failure()
- uses: actions/upload-artifact@v4
Expand Down
31 changes: 15 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,25 @@ repos:
rev: v0.1.8
hooks:
- id: ripsecrets
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
hooks:
- id: autoflake
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
- id: ruff-format
args:
- --py310-plus
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 24.10.0
- --line-length=110
- repo: https://github.com/PyCQA/prospector
rev: v1.13.3
hooks:
- id: black
- id: prospector
args:
- --line-length=110
- --profile=app/.prospector.yaml
- --tool=ruff
- --die-on-tool-error
- --output-format=pylint
additional_dependencies:
- prospector-profile-duplicated==1.8.0 # pypi
- prospector-profile-utils==1.13.0 # pypi
- ruff==0.8.1 # pypi
- repo: https://github.com/sbrunner/jsonschema-validator
rev: 0.3.2
hooks:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ checks: prospector acceptance-prospector ## Run the checks
.PHONY: acceptance-prospector
acceptance-prospector: build-acceptance ## Run Prospector on acceptance
docker run --rm --volume=${PWD}/acceptance_tests:/acceptance_tests --volume=${PWD}/acceptance_tests:/acceptance_tests/acceptance_tests $(DOCKER_BASE)-acceptance:$(DOCKER_TAG) \
prospector --output=pylint --die-on-tool-error acceptance_tests
prospector --output=pylint --die-on-tool-error --without=ruff acceptance_tests

.PHONY: prospector
prospector: build-checker ## Run Prospector
Expand Down
17 changes: 2 additions & 15 deletions acceptance_tests/.prospector.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
inherits:
- utils:base
- utils:no-design-checks
- utils:base-less-strict
- utils:c2cwsgiutils
- utils:fix
- duplicated

pylint:
disable:
- missing-timeout # Done by c2cwsgiutils

mypy:
run: false

bandit:
run: false

pyroma:
run: false
3 changes: 3 additions & 0 deletions acceptance_tests/acceptance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@


def wait_sync(app_connection, name, hash_):
"""Wait for the sync to be done."""

def what():
status = app_connection.get_json("1/status", headers={"X-Scm-Secret": "changeme"})
for slave_name, slave in status["slaves"].items():
Expand Down Expand Up @@ -39,4 +41,5 @@ def what():


def get_hash(cwd):
"""Get the hash of the current git repository."""
return subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=cwd).decode("utf-8").strip()
8 changes: 2 additions & 6 deletions acceptance_tests/acceptance/file/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

@pytest.fixture(scope="package")
def composition(request):
"""
Fixture that will wait that the composition is started, used for all the tests.
"""
"""Fixture that will wait that the composition is started, used for all the tests."""
del request
for slave in ("api",):
path = os.path.join("/config", slave)
Expand All @@ -22,8 +20,6 @@ def composition(request):

@pytest.fixture
def app_connection(composition): # pylint: disable=redefined-outer-name
"""
Fixture that returns a connection to a running batch container.
"""
"""Fixture that returns a connection to a running batch container."""
del composition
return Connection(base_url="http://api_file:8080/scm/", origin="http://example.com/")
3 changes: 2 additions & 1 deletion acceptance_tests/acceptance/file/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
import os

import yaml
from acceptance import get_hash, wait_sync
from c2cwsgiutils.acceptance.connection import Connection

from acceptance import get_hash, wait_sync


def test_ok(app_connection: Connection):
test_git_hash = get_hash("/repos/test_git")
Expand Down
8 changes: 2 additions & 6 deletions acceptance_tests/acceptance/inline/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

@pytest.fixture(scope="package")
def composition(request):
"""
Fixture that will wait that the composition is started, used for all the tests.
"""
"""Fixture that will wait that the composition is started, used for all the tests."""
del request
for slave in ("api",):
path = os.path.join("/config", slave)
Expand All @@ -22,8 +20,6 @@ def composition(request):

@pytest.fixture
def app_connection(composition): # pylint: disable=redefined-outer-name
"""
Fixture that returns a connection to a running batch container.
"""
"""Fixture that returns a connection to a running batch container."""
del composition
return Connection(base_url="http://api_inline:8080/scm/", origin="http://example.com/")
3 changes: 2 additions & 1 deletion acceptance_tests/acceptance/inline/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import os

from acceptance import get_hash, wait_sync
from c2cwsgiutils.acceptance.connection import Connection

from acceptance import get_hash, wait_sync


def test_ok(app_connection: Connection):
test_git_hash = get_hash("/repos/test_git")
Expand Down
10 changes: 4 additions & 6 deletions acceptance_tests/acceptance/normal/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@


def wait_slaves():
"""Wait for the slaves to be up."""

def what() -> bool:
r = requests.get("http://api:8080/scm/1/status", headers={"X-Scm-Secret": "changeme"})
if r.status_code == 200:
Expand Down Expand Up @@ -41,9 +43,7 @@ def what() -> bool:

@pytest.fixture(scope="package")
def composition(request):
"""
Fixture that will wait that the composition is started, used for all the tests.
"""
"""Fixture that will wait that the composition is started, used for all the tests."""
del request
for slave in ("api", "slave", "slave-others"):
path = os.path.join("/config", slave)
Expand All @@ -57,8 +57,6 @@ def composition(request):

@pytest.fixture
def app_connection(composition: None): # pylint: disable=redefined-outer-name
"""
Fixture that returns a connection to a running batch container.
"""
"""Fixture that returns a connection to a running batch container."""
del composition
return Connection(base_url="http://api:8080/scm/", origin="http://example.com/")
3 changes: 2 additions & 1 deletion acceptance_tests/acceptance/normal/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

import pytest
import requests
from acceptance import get_hash, wait_sync
from c2cwsgiutils.acceptance.connection import Connection

from acceptance import get_hash, wait_sync


@pytest.fixture()
def git_source(app_connection: Connection):
Expand Down
38 changes: 19 additions & 19 deletions acceptance_tests/package-lock.json

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

2 changes: 1 addition & 1 deletion acceptance_tests/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"commander": "12.1.0",
"puppeteer": "23.6.1"
"puppeteer": "23.9.0"
},
"type": "module"
}
Loading

0 comments on commit 12ce4a2

Please sign in to comment.