Skip to content

Commit

Permalink
feat: configure renovate, nd separate requirements for each tox.ini e…
Browse files Browse the repository at this point in the history
…nvironment (use .in files for spec).
  • Loading branch information
misohu committed Dec 5, 2022
1 parent 429a152 commit fe43fb0
Show file tree
Hide file tree
Showing 21 changed files with 627 additions and 81 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/get-charm-paths.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash -x

# Finds the charms in this repo, outputing them as JSON
# Finds the charms in this repo, outputting them as JSON
# Will return one of:
# * the relative paths of the directories listed in `./charms`, if that directory exists
# * "./", if the root directory has a "metadata.yaml" file
# * otherwise, error
#
# Modifed from: https://stackoverflow.com/questions/63517732/github-actions-build-matrix-for-lambda-functions/63736071#63736071
# Modified from: https://stackoverflow.com/questions/63517732/github-actions-build-matrix-for-lambda-functions/63736071#63736071
CHARMS_DIR="./charms"
if [ -d "$CHARMS_DIR" ];
then
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.coverage
.kube/
*.charm
build/
__pycache__/
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ MinIO can be operated in the following modes:
* `gateway`: MinIO works as a gateway to a separate blob storage (such as Amazon S3),
providing an access layer to your data for in-cluster workloads

### Exmple using `gateway` mode
### Example using `gateway` mode

This charm supports using the following backing data storage services:
* s3
Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright 2022 Canonical Ltd.
# See LICENSE file for licensing details.

# Testing tools configuration
[tool.coverage.run]
branch = true

[tool.coverage.report]
show_missing = true

[tool.pytest.ini_options]
minversion = "6.0"
log_cli_level = "INFO"

# Formatting tools configuration
[tool.black]
line-length = 99
target-version = ["py38"]

[tool.isort]
line_length = 99
profile = "black"

# Linting tools configuration
[tool.flake8]
max-line-length = 99
max-doc-length = 99
max-complexity = 10
exclude = [".git", "__pycache__", ".tox", "build", "dist", "*.egg_info", "venv"]
select = ["E", "W", "F", "C", "N", "R", "D", "H"]
# Ignore W503, E501 because using black creates errors with this
# Ignore D107 Missing docstring in __init__
ignore = ["W503", "E501", "D107"]
# D100, D101, D102, D103: Ignore missing docstrings in tests
per-file-ignores = ["tests/*:D100,D101,D102,D103,D104"]
docstring-convention = "google"
# Check for properly formatted copyright header in each file
copyright-check = "True"
copyright-author = "Canonical Ltd."
copyright-regexp = "Copyright\\s\\d{4}([-,]\\d{4})*\\s+%(author)s"
34 changes: 34 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"rebaseWhen": "behind-base-branch",
"dependencyDashboard": false,
"pip-compile": {
"fileMatch": [
"(^|/)requirements.*\\.in$"
],
"lockFileMaintenance": {
"schedule": null
}
},
"packageRules": [
{
"groupName": "testing deps",
"matchPackagePatterns": [
"^black$",
"codespell",
"flake8",
"flake8-builtins",
"flake8-copyright",
"flake8-docstrings",
"isort",
"pep8-naming",
"pyproject-flake8",
"pytest",
"pytest-asyncio",
"selenium",
"selenium-wire"
],
"automerge": true
}
]
}
2 changes: 2 additions & 0 deletions requirements-fmt.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
black
isort
22 changes: 22 additions & 0 deletions requirements-fmt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile --resolver=backtracking ./requirements-fmt.in
#
black==22.10.0
# via -r ./requirements-fmt.in
click==8.1.3
# via black
isort==5.10.1
# via -r ./requirements-fmt.in
mypy-extensions==0.4.3
# via black
pathspec==0.10.2
# via black
platformdirs==2.5.4
# via black
tomli==2.0.1
# via black
typing-extensions==4.4.0
# via black
5 changes: 5 additions & 0 deletions requirements-integration.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
juju
pytest-operator
selenium
selenium-wire
-r requirements.txt
Loading

0 comments on commit fe43fb0

Please sign in to comment.