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

Upgrade to repo-config v0.5.2 #587

Merged
merged 12 commits into from
Aug 29, 2023
43 changes: 3 additions & 40 deletions .cookiecutter-replay.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cookiecutter": {
"Introduction": "]\n\nWelcome to repo-config Cookiecutter template!\n\nThis template will help you to create a new repository for your project. You will be asked to provide some information about your project.\n\nHere is an explanation of what each variable is for and will be used for:\n\n* `type`: The type of repository. It must be chosen from the list.\n\n* `name`: The name of the project. This will be used to build defaults for\n other inputs, such as `title`, `python_package`, etc. It should be one word,\n using only alphanumeric characters (and starting with a letter). It can\n include also `_` and `-` which will be handled differently when building\n other variables from it (replaced by spaces in titles for example).\n\n* `description`: A short description of the project. It will be used as the\n description in the `README.md`, `pyproject.toml`, `mkdocs.yml`, etc.\n\n* `title`: A human-readable name or title for the project. It will be used in\n the `README.md`, `CONTRIBUTING.md`, and other files to refer to the project,\n as well as the site title in `mkdocs.yml`.\n\n* `keywords`: A comma-separated list of keywords that will be used in the\n `pyproject.toml` file. If left untouched, it will use only some predefined\n keywords. If anything else is entered, it will be **added** to the default\n keywords.\n\n* `github_org`: The GitHub handle of the organization where the project will\n reside. This will be used to generate links to the project on GitHub.\n\n* `license`: Currently, only two options are provided: `MIT`, which should be\n used for open-source projects, and `Proprietary`, which should be used for\n closed-source projects. This will be added to file headers and used as the\n license in `pyproject.toml`.\n\n* `author_name`, `author_email`: The name and email address of the author of\n the project. They will be used in the copyright notice in file headers and\n as the author in `pyproject.toml`.\n\n* `python_package`: The Python package in which this project will reside. All\n files provided by this project should be located in this package. This needs\n to be a list of valid Python identifiers separated by dots. The source file\n structure will be derived from this. For example, `frequenz.actor.example`\n will generate files in `src/frequenz/actor/example`.\n\n* `pypi_package_name`: The name of the PyPI/wheel/distribution package. This\n should be consistent with the `python_package`, usually replacing `.` with\n `-`. For example, `frequenz-actor-example`.\n\n* `github_repo_name`: The handle of the GitHub repository where the project\n will reside. This will be used to generate links to the project on GitHub and\n as the top-level directory name.\n\n* `default_codeowners`: A space-separated list of GitHub teams (`@org/team`) or\n users (`@user`) that will be the default code owners for this project. This\n will be used to build the `CODEOWNERS` file. Please refer to the [code owners\n documentation] for more details on the valid syntax.\n\n[code owners documentation]: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners\n\n\n[Please press any key to continue",
"Introduction": "",
"type": "lib",
"name": "sdk",
"description": "A development kit to interact with the Frequenz development platform",
Expand All @@ -14,43 +14,6 @@
"pypi_package_name": "frequenz-sdk",
"github_repo_name": "frequenz-sdk-python",
"default_codeowners": "@frequenz-floss/python-sdk-team",
"_extensions": [
"jinja2_time.TimeExtension",
"local_extensions.as_identifier",
"local_extensions.default_codeowners",
"local_extensions.github_repo_name",
"local_extensions.introduction",
"local_extensions.keywords",
"local_extensions.pypi_package_name",
"local_extensions.python_package",
"local_extensions.src_path",
"local_extensions.title"
],
"_template": "gh:frequenz-floss/frequenz-repo-config-python",
},
"_cookiecutter": {
"Introduction": "{{cookiecutter | introduction}}",
"type": [
"actor",
"api",
"app",
"lib",
"model"
],
"name": null,
"description": null,
"title": "{{cookiecutter | title}}",
"keywords": "(comma separated: 'frequenz', <type> and <name> are included automatically)",
"github_org": "frequenz-floss",
"license": [
"MIT",
"Proprietary"
],
"author_name": "Frequenz Energy-as-a-Service GmbH",
"author_email": "[email protected]",
"python_package": "{{cookiecutter | python_package}}",
"pypi_package_name": "{{cookiecutter | pypi_package_name}}",
"github_repo_name": "{{cookiecutter | github_repo_name}}",
"default_codeowners": "(like @some-org/some-team; defaults to a team based on the repo type)"
"_template": "gh:frequenz-floss/frequenz-repo-config-python"
}
}
}
26 changes: 26 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# EditorConfig is awesome: https://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Set default charset, indent style and trimming of whitespace
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,md,proto,py,pyi,toml,yaml,yml}}]
charset = utf-8
indent_style = space
trim_trailing_whitespace = true

# 4 space indentation
[*.{py,pyi}]
indent_size = 4

# 2 space indentation
[{.editorconfig,CODEOWNERS,LICENSE,*.{in,json,proto,toml,yaml,yml}}]
indent_size = 2

# No indentation size specified for *.md because different blocks have
# different indentation rules
3 changes: 3 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,16 @@
- "src/frequenz/sdk/power/**"

"part:tests":
- "**/conftest.py"
- "tests/**"

"part:tooling":
- "**/*.ini"
- "**/*.toml"
- "**/*.yaml"
- "**/*.yml"
- "**/conftest.py"
- ".editorconfig"
- ".git*"
- ".git*/**"
- "docs/*.py"
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
steps:
- name: Fetch sources
uses: actions/checkout@v3
with:
submodules: true

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -61,6 +63,8 @@ jobs:
steps:
- name: Fetch sources
uses: actions/checkout@v3
with:
submodules: true

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -115,6 +119,8 @@ jobs:
steps:
- name: Fetch sources
uses: actions/checkout@v3
with:
submodules: true

- name: Setup Git user and e-mail
uses: frequenz-floss/setup-git-user@v2
Expand Down Expand Up @@ -192,6 +198,8 @@ jobs:
- name: Fetch sources
if: steps.mike-metadata.outputs.version
uses: actions/checkout@v3
with:
submodules: true

- name: Setup Git user and e-mail
if: steps.mike-metadata.outputs.version
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ jobs:
uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # 4.3.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
dot: true
10 changes: 7 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
exclude .cookiecutter-replay.json
exclude .darglint
exclude .editorconfig
exclude .gitignore
exclude CODEOWNERS
exclude minimum-requirements-ci.txt
exclude CONTRIBUTING.md
exclude mkdocs.yml
exclude noxfile.py
exclude src/conftest.py
recursive-exclude .github *
recursive-exclude benchmarks *
recursive-exclude examples *
recursive-exclude docs *
recursive-exclude tests *
recursive-include py *.pyi
8 changes: 6 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

"""Configuration file for nox."""

from frequenz.repo.config import RepositoryType, nox
from frequenz.repo.config import nox
from frequenz.repo.config.nox import default

nox.configure(RepositoryType.LIB)
config = default.lib_config.copy()
config.opts.mypy = [] # Set in pyproject.toml

nox.configure(config)
16 changes: 12 additions & 4 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[lib] == 0.4.0",
"frequenz-repo-config[lib] == 0.5.2",
]
build-backend = "setuptools.build_meta"

Expand Down Expand Up @@ -63,7 +63,7 @@ dev-mkdocs = [
"mkdocs-material == 9.2.5",
"mkdocs-section-index == 0.3.5",
"mkdocstrings[python] == 0.22.0",
"frequenz-repo-config[lib] == 0.4.0",
"frequenz-repo-config[lib] == 0.5.2",
]
dev-mypy = [
"mypy == 1.5.1",
Expand All @@ -72,14 +72,15 @@ dev-mypy = [
# For checking the noxfile, docs/ script, and tests
"frequenz-sdk[dev-mkdocs,dev-noxfile,dev-pytest]",
]
dev-noxfile = ["nox == 2023.4.22", "frequenz-repo-config[lib] == 0.4.0"]
dev-noxfile = ["nox == 2023.4.22", "frequenz-repo-config[lib] == 0.5.2"]
dev-pylint = [
"pylint == 2.17.5",
# For checking the noxfile, docs/ script, and tests
"frequenz-sdk[dev-mkdocs,dev-noxfile,dev-pytest]",
]
dev-pytest = [
"pytest == 7.4.0",
"frequenz-repo-config[extra-lint-examples] == 0.5.2",
"pytest-mock == 3.11.1",
"pytest-asyncio == 0.21.1",
"time-machine == 2.12.0",
Expand Down Expand Up @@ -134,6 +135,13 @@ testpaths = ["tests", "src"]
asyncio_mode = "auto"
required_plugins = ["pytest-asyncio", "pytest-mock"]

[tool.mypy]
explicit_package_bases = true
namespace_packages = true
no_incremental = true
packages = ["frequenz.sdk"]
strict = true

[[tool.mypy.overrides]]
module = [
"async_solipsism",
Expand Down
Loading