Conversation
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/51322711-9cdb-484c-8a37-2aa0ad08ac75 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/51322711-9cdb-484c-8a37-2aa0ad08ac75 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
setup.cfg
|
@copilot some of the tests are failing. See the GH Actions config for details. Please fix the issue, and then create a ticket regarding what went wrong in terms of the agent inferring which tests were relevant to run. |
…rementsTxt Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/f7cfd326-fb26-42fa-af09-f0b5d180b7dd Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Fixed in 62e9919. The 5 failing The root cause was that when I searched for tests to update, I only looked for direct callers of |
|
@copilot some of the tests are still failing. See the GH Actions logs for details. Please fix the issue, and then create a ticket regarding what went wrong in terms of the agent inferring which tests were relevant to run. |
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/98169524-606e-47a4-9c6b-b498a66104d0 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Fixed in 32abab5. The root cause was stale Tests in my new Fix: added |
|
@copilot some of the tests are still failing. See the GH Actions logs for details. Please fix the issue, and then create a ticket regarding what went wrong in terms of the agent inferring which tests were relevant to run. |
…upCFGManager to missing test contexts Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/9ec216b2-e65e-4fec-aa2f-6addd5a627e1 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Fixed in bfb2905. There were two root causes: 1. 2. Missing Fixed |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| result: dict[str, list[Dependency]] = {} | ||
| for extra_name in cfg["options.extras_require"].options(): # type: ignore[union-attr] | ||
| raw_value: str | None = cfg["options.extras_require"][extra_name].value # type: ignore[union-attr] | ||
| if raw_value is None: # pragma: no cover |
There was a problem hiding this comment.
@copilot please remove all pragma comments. Also all "type:" comments should be converted to "pyright:".
We should create a GitHub ticket for this lesson so that we make a hook which forbids particular keywords in comments, provided via CLI. This is one of them: "pragma". Another is "type:"
There was a problem hiding this comment.
Done in 841f512. Removed all # pragma: no cover comments and # type: ignore[union-attr] comments from setup_cfg/deps.py. Since Option.value returns str | None but is always a non-None string when parsed from a file (empty values return ''), I simplified the code to use raw_value or "" instead of the unreachable None checks. Pyright requires no type suppression for this code.
Filed issue #1820 to track adding a prek hook that forbids pragma: and type: ignore keywords in comments.
…_cfg/deps.py Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/dddc5605-30c3-4d38-9d88-5e6b7fc9b894 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
| def get_setup_cfg_dep_groups() -> dict[str, list[Dependency]]: | ||
| """Get dependency groups from setup.cfg [options.extras_require]. | ||
|
|
||
| This reads the ``[options.extras_require]`` section of ``setup.cfg``, which is the |
There was a problem hiding this comment.
@copilot please remove double backticks in docstrings.
Please also create a lesson about this - with the suggested solution that we create a prek hook to forbid double backticks in docstrings, and update agent skills accordingly.
| Usually this is just the dependencies in the ``project.dependencies`` section | ||
| of the ``pyproject.toml`` file. When the poetry backend is active, also | ||
| reads from ``[tool.poetry.dependencies]``. | ||
| reads from ``[tool.poetry.dependencies]``. Also merges from ``setup.cfg`` |
|
|
||
| Reads from ``[dependency-groups]`` (PEP 735). When the poetry backend | ||
| is active, also reads from ``[tool.poetry.group.*.dependencies]``. | ||
| is active, also reads from ``[tool.poetry.group.*.dependencies]``. Also |
There was a problem hiding this comment.
Again -remove double backticks
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/df0af713-7fa1-4f9f-82e6-b8cd5da229d6 Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
|
Per #1823 I want to close this PR for now until some bigger questions are resolved. |
src/usethis/_file/setup_cfg/deps.pywithget_setup_cfg_project_deps()andget_setup_cfg_dep_groups()functionssrc/usethis/_deps.pyto read from setup.cfg and merge those deps with pyproject.toml deps_deps.pyto mention setup.cfgtests/usethis/_file/setup_cfg/test_deps.pywith 17 unit tests (100% coverage)tests/usethis/test_deps.pyto addSetupCFGManager()to all relevant test contexts and add integration tests for setup.cfgtests/usethis/test_init.py::TestWriteSimpleRequirementsTxtby addingSetupCFGManager()context (CI failure Add issue template for tasks #1)tests/conftest.py: resetusethis_config.backendandusethis_config.inferred_backendin autouse fixture to prevent test pollution (CI failure Add a new GitHub issue template for tasks #2)src/usethis/_config.py: addtry-finallytoUsethisConfig.set()so config state is always restored even when exceptions are raised insidewithblocks (CI failure Configure testing suite #3 — root cause of cascading "empty output" failures)tests/usethis/_tool/test_base.py: addSetupCFGManager()toTestIsUsedandTestIsDeclaredAsDepteststests/usethis/_core/test_core_tool.py: addSetupCFGManager()to ~28 tests missing it (TestCoverage, TestDeptry, TestRequirementsTxt, TestPyprojectFmt)# pragma: no covercomments and# type: ignore[union-attr]comments fromsetup_cfg/deps.py; simplify code to useraw_value or ""\`...```) with single backticks in all docstrings written in this PR; filed issue Add prek hook to forbid double backticks in docstrings #1822 for a prek hook to enforce this