Skip to content

Commit

Permalink
Bump repo-config to v0.6.2
Browse files Browse the repository at this point in the history
Signed-off-by: TalweSingh <talwinder.singh@frequenz.com>
  • Loading branch information
TalweSingh committed Oct 10, 2023
1 parent 83e96a9 commit 1e279ed
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 23 deletions.
25 changes: 20 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
time: "07:00"
labels:
- "part:tooling"
Expand All @@ -13,11 +13,28 @@ updates:
versioning-strategy: auto
# Allow up to 10 open pull requests for updates to dependency versions
open-pull-requests-limit: 10
# We group production and development ("optional" in the context of
# pyproject.toml) dependency updates when they are patch and minor updates,
# so we end up with less PRs being generated.
# Major updates are still managed, but they'll create one PR per
# dependency, as major updates are expected to be breaking, it is better to
# manage them individually.
groups:
required:
dependency-type: "production"
update-types:
- "minor"
- "patch"
optional:
dependency-type: "development"
update-types:
- "minor"
- "patch"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
time: "06:00"
labels:
- "part:tooling"
Expand All @@ -34,10 +51,8 @@ updates:
# + `allow` one doesn't seem to work.
ignore:
- dependency-name: "submodules/frequenz-api-common"
# The google api common repo changes very seldom, so there is no need to
# check very often.
schedule:
interval: "monthly"
interval: "weekly"
time: "06:00"
labels:
- "part:tooling"
Expand Down
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@

"part:protobuf":
- "proto/**"

"part:python":
- "py/**"
31 changes: 28 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,17 @@ jobs:
- ubuntu-20.04
python:
- "3.11"
nox-session:
# To speed things up a bit we use the special ci_checks_max session
# that uses the same venv to run multiple linting sessions
- "ci_checks_max"
- "pytest_min"
runs-on: ${{ matrix.os }}

steps:
- name: Print environment (debug)
run: env

- name: Fetch sources
uses: actions/checkout@v3
with:
Expand All @@ -73,11 +81,25 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev-noxfile]
pip freeze
- name: Create nox venv
env:
NOX_SESSION: ${{ matrix.nox-session }}
run: nox --install-only -e "$NOX_SESSION"

- name: Print pip freeze for nox venv (debug)
env:
NOX_SESSION: ${{ matrix.nox-session }}
run: |
. ".nox/$NOX_SESSION/bin/activate"
pip freeze
deactivate
- name: Run nox
# To speed things up a bit we use the special ci_checks_max session
# that uses the same venv to run multiple linting sessions
run: nox -e ci_checks_max pytest_min
env:
NOX_SESSION: ${{ matrix.nox-session }}
run: nox -R -e "$NOX_SESSION"
timeout-minutes: 10

build:
Expand All @@ -99,6 +121,7 @@ jobs:
run: |
python -m pip install -U pip
python -m pip install -U build
pip freeze
- name: Build the source and binary distribution
run: python -m build
Expand Down Expand Up @@ -133,6 +156,7 @@ jobs:
run: |
python -m pip install -U pip
python -m pip install .[dev-mkdocs]
pip freeze
- name: Generate the documentation
env:
Expand Down Expand Up @@ -215,6 +239,7 @@ jobs:
run: |
python -m pip install -U pip
python -m pip install .[dev-mkdocs]
pip freeze
- name: Fetch the gh-pages branch
if: steps.mike-metadata.outputs.version
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
exclude .cookiecutter-replay.json
exclude .darglint
exclude .editorconfig
exclude .gitignore
exclude .gitmodules
Expand All @@ -9,6 +8,7 @@ exclude mkdocs.yml
exclude noxfile.py
exclude src/conftest.py
recursive-exclude .github *
recursive-exclude benchmarks *
recursive-exclude docs *
recursive-exclude pytests *
recursive-include py *.pyi
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ theme:
features:
- content.code.annotate
- content.code.copy
- navigation.indexes
- navigation.instant
- navigation.tabs
- navigation.top
Expand Down Expand Up @@ -108,7 +109,6 @@ plugins:
- https://grpc.github.io/grpc/python/objects.inv
- https://typing-extensions.readthedocs.io/en/stable/objects.inv
- search
- section-index

# Preview controls
watch:
Expand Down
7 changes: 7 additions & 0 deletions py/frequenz/api/common/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# License: MIT
# Copyright © 2023 Frequenz Energy-as-a-Service GmbH

"""Frequenz common gRPC API and bindings.
TODO(cookiecutter): Add a more descriptive module description.
"""
59 changes: 47 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

[build-system]
requires = [
"setuptools == 67.7.2",
"setuptools == 68.1.0",
"setuptools_scm[toml] == 7.1.0",
"frequenz-repo-config[api] == 0.5.2",
"frequenz-repo-config[api] == 0.6.2",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -36,38 +36,43 @@ name = "Frequenz Energy-as-a-Service GmbH"
email = "floss@frequenz.com"

[project.optional-dependencies]
dev-docstrings = [
dev-flake8 = [
"flake8 == 6.1.0",
"flake8-docstrings == 1.7.0",
"flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml
"pydoclint == 0.3.1",
"pydocstyle == 6.3.0",
"darglint == 1.8.1",
"tomli == 2.0.1", # Needed by pydocstyle to read pyproject.toml
]
dev-formatting = ["black == 23.9.1", "isort == 5.12.0"]
dev-mkdocs = [
"mike == 1.1.2",
"mkdocs-gen-files == 0.5.0",
"mkdocs-literate-nav == 0.6.1",
"mkdocs-material == 9.4.2",
"mkdocs-section-index == 0.3.8",
"mkdocstrings[python] == 0.23.0",
"frequenz-repo-config[api] == 0.5.2",
"frequenz-repo-config[api] == 0.6.2",
]
dev-mypy = [
"mypy == 1.5.1",
"grpc-stubs == 1.53.0.2",
# For checking the noxfile, docs/ script, and tests
"frequenz-api-common[dev-mkdocs,dev-noxfile,dev-pytest]",
]
dev-noxfile = ["nox == 2023.4.22", "frequenz-repo-config[api] == 0.5.2"]
dev-noxfile = [
"nox == 2023.4.22",
"frequenz-repo-config[api] == 0.6.2",
]
dev-pylint = [
"pylint == 2.17.6",
# For checking the noxfile, docs/ script, and tests
"frequenz-api-common[dev-mkdocs,dev-noxfile,dev-pytest]",
]
dev-pytest = [
"pytest == 7.4.2",
"frequenz-repo-config[extra-lint-examples] == 0.5.2",
"frequenz-repo-config[extra-lint-examples] == 0.6.2",
]
dev = [
"frequenz-api-common[dev-mkdocs,dev-docstrings,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
"frequenz-api-common[dev-mkdocs,dev-flake8,dev-formatting,dev-mkdocs,dev-mypy,dev-noxfile,dev-pylint,dev-pytest]",
]

[project.urls]
Expand All @@ -85,8 +90,22 @@ profile = "black"
line_length = 88
src_paths = ["benchmarks", "examples", "src", "tests"]

[tool.frequenz-repo-config.protobuf]
include_paths = ["submodules/api-common-protos"]
[tool.flake8]
# We give some flexibility to go over 88, there are cases like long URLs or
# code in documenation that have extra indentation. Black will still take care
# of making everything that can be 88 wide, 88 wide.
max-line-length = 100
extend-ignore = [
"E203", # Whitespace before ':' (conflicts with black)
"W503", # Line break before binary operator (conflicts with black)
]
# pydoclint options
style = "google"
check-return-types = false
check-yield-types = false
arg-type-hints-in-docstring = false
arg-type-hints-in-signature = true
allow-init-docstring = true

[tool.pylint.similarities]
ignore-comments = ['yes']
Expand All @@ -103,11 +122,27 @@ disable = [
# pylint's unsubscriptable check is buggy and is not needed because
# it is a type-check, for which we already have mypy.
"unsubscriptable-object",
# Checked by flake8
"line-too-long",
"unused-variable",
"unnecessary-lambda-assignment",
]

[tool.pytest.ini_options]
testpaths = ["pytests"]

[tool.mypy]
explicit_package_bases = true
namespace_packages = true
# This option disables mypy cache, and it is sometimes useful to enable it if
# you are getting weird intermittent error, or error in the CI but not locally
# (or vice versa). In particular errors saying that type: ignore is not
# used but getting the original ignored error when removing the type: ignore.
# See for example: https://github.com/python/mypy/issues/2960
#no_incremental = true
packages = ["frequenz.api.common"]
strict = true

[tool.setuptools.package-dir]
"" = "py"

Expand Down

0 comments on commit 1e279ed

Please sign in to comment.