-
Notifications
You must be signed in to change notification settings - Fork 7
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
Update pytest and sybil #221
Conversation
Skipping release notes for this dependency-only update, let me know if you want notes. |
Not sure what the CIs problem is really |
I should have mentioned this, but I also had some work done on it, I think I also bumped into tests issues and got distracted with something else and dropped it. Reading the tests is hard because the tests do generate a whole project for each type of repo, so you have to dig in all the ton of output to look for what it failed. Besides some weirdness when running
|
b80e5cb
to
0921832
Compare
0921832
to
8ab7125
Compare
I can't run it successfully locally, but the CI is happy 😆 |
Seems to work locally for me using Maybe you are using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the suggested change, this would also needs a note in the release notes and upgrade instructions as bumping the dependency is a breaking change (downstream projects will need to upgrade too). But again, locally it works with only widening the dependencies for extra-lint-examples
.
Sybil 6 has type information, so we can also remove the mypy
exception for it.
Here is a patch of local changes I made that still pass all tests:
diff --git a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml
index c603793..d63cd7b 100644
--- a/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml
+++ b/cookiecutter/{{cookiecutter.github_repo_name}}/pyproject.toml
@@ -193,7 +193,7 @@ packages = ["{{cookiecutter.python_package}}"]
strict = true
[[tool.mypy.overrides]]
-module = ["mkdocs_macros.*", "sybil", "sybil.*"]
+module = ["mkdocs_macros.*"]
ignore_missing_imports = true
{%- if cookiecutter.type == "api" %}
diff --git a/pyproject.toml b/pyproject.toml
index b396bf2..022ef0d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -63,8 +63,8 @@ lib = []
model = []
extra-lint-examples = [
"pylint >= 2.17.3, < 4",
- "pytest >= 7.4.2, < 9",
- "sybil >= 6.0.3, < 7",
+ "pytest >= 7.3.0, < 9",
+ "sybil >= 5.0.3, < 7",
]
dev-flake8 = [
"flake8 == 6.1.0",
@@ -188,8 +188,6 @@ module = [
"github_action_utils",
"mkdocs_macros.*",
"semver.version",
- "sybil",
- "sybil.*",
]
ignore_missing_imports = true
diff --git a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml
index 0cbe3ee..f12ef54 100644
--- a/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml
+++ b/tests_golden/integration/test_cookiecutter_generation/actor/frequenz-actor-test/pyproject.toml
@@ -163,7 +163,7 @@ packages = ["frequenz.actor.test"]
strict = true
[[tool.mypy.overrides]]
-module = ["mkdocs_macros.*", "sybil", "sybil.*"]
+module = ["mkdocs_macros.*"]
ignore_missing_imports = true
[tool.setuptools_scm]
diff --git a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml
index 27cf961..904116b 100644
--- a/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml
+++ b/tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/pyproject.toml
@@ -156,7 +156,7 @@ packages = ["frequenz.api.test"]
strict = true
[[tool.mypy.overrides]]
-module = ["mkdocs_macros.*", "sybil", "sybil.*"]
+module = ["mkdocs_macros.*"]
ignore_missing_imports = true
[tool.setuptools.package-dir]
diff --git a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml
index 3234e24..ae162ed 100644
--- a/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml
+++ b/tests_golden/integration/test_cookiecutter_generation/app/frequenz-app-test/pyproject.toml
@@ -162,7 +162,7 @@ packages = ["frequenz.app.test"]
strict = true
[[tool.mypy.overrides]]
-module = ["mkdocs_macros.*", "sybil", "sybil.*"]
+module = ["mkdocs_macros.*"]
ignore_missing_imports = true
[tool.setuptools_scm]
diff --git a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml
index 1a15745..8ae960f 100644
--- a/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml
+++ b/tests_golden/integration/test_cookiecutter_generation/lib/frequenz-test-python/pyproject.toml
@@ -159,7 +159,7 @@ packages = ["frequenz.test"]
strict = true
[[tool.mypy.overrides]]
-module = ["mkdocs_macros.*", "sybil", "sybil.*"]
+module = ["mkdocs_macros.*"]
ignore_missing_imports = true
[tool.setuptools_scm]
diff --git a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml
index e61c4be..c163225 100644
--- a/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml
+++ b/tests_golden/integration/test_cookiecutter_generation/model/frequenz-model-test/pyproject.toml
@@ -163,7 +163,7 @@ packages = ["frequenz.model.test"]
strict = true
[[tool.mypy.overrides]]
-module = ["mkdocs_macros.*", "sybil", "sybil.*"]
+module = ["mkdocs_macros.*"]
ignore_missing_imports = true
[tool.setuptools_scm]
pyproject.toml
Outdated
"pytest >= 7.4.2, < 9", | ||
"sybil >= 6.0.3, < 7", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we should only widen these to avoid making this a breaking change and still support pytest 7.x (if we are not affected by the breaking changes in 8):
"pytest >= 7.4.2, < 9", | |
"sybil >= 6.0.3, < 7", | |
"pytest >= 7.3.0, < 9", | |
"sybil >= 5.0.3, < 7", |
I did some local testing with this and it seems to work.
I think we should add a note to the release notes even if it is not a breaking change, as a new feature, like "Add support for pytest 8.x". |
But only widening implies we should keep the exception so it still works on the lowest version, no? |
Yeah, true. I think it would be nice for a smoother transition to first be backwards compatible and we create an issue to remove |
I'm thinking that this could be a v0.8.1 release instead, as it is a non breaking change (with the changes proposed in my sub-PR) and it will allow downstream project to upgrade the |
* pytest 8.0.0 * sybil 6.0.3 Signed-off-by: Mathias L. Baumann <[email protected]>
The `pytest` and `sybil` dependencies can be purely widen, supporting the same oldest versions as before, as we are not affected by the breaking changes. This allows us to keep backwards compatibility for downstream project. Signed-off-by: Leandro Lucarella <[email protected]>
When running tests, we now use a `sybil` version that is properly typed, so we don't need to exclude it from `mypy` anymore. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
d232f19
to
4b09189
Compare
fixes #219