Skip to content

Fix python-foreman build, pylint errors and lint config - #149

Open
eb4x wants to merge 3 commits into
masterfrom
fix/build-and-lint
Open

Fix python-foreman build, pylint errors and lint config#149
eb4x wants to merge 3 commits into
masterfrom
fix/build-and-lint

Conversation

@eb4x

@eb4x eb4x commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Build: python-foreman==0.4.20 (last release, 2018) builds via autosemver, which needs pkg_resources — removed in setuptools >= 81. Add constraints.txt pinning setuptools<81 and install with PIP_CONSTRAINT=constraints.txt pip install -r requirements.txt, which also applies to pip's isolated build environment. Drops the old dulwich/autosemver pins and adds the missing python-cinderclient. README and CLAUDE.md updated.
  • Fixes (found by pylint -E):
    • cleanup.py: regions = regions.append(...) set regions to None whenever --region was given.
    • access.py, hypervisor.py: remove unused / dead assignments.
    • .pylintrc: drop suggestion-mode, disable possibly-used-before-assignment.
    • test.sh: skip request_specs.py, which imports the nova package that is not in requirements.txt.
  • Docs: CLAUDE.md gains notes on notify/ mail templates and the archive/ convention.

Test plan

  • pylint -E access.py cleanup.py hypervisor.py passes
  • Fresh venv (Python 3.14): PIP_CONSTRAINT=constraints.txt pip install -r requirements.txt succeeds, python-foreman 0.4.20 builds and imports; without the constraint it fails with ModuleNotFoundError: No module named 'pkg_resources'
  • ./test.sh passes
  • ./cleanup.py --region <region> ... no longer crashes on None regions

🤖 Generated with Claude Code

eb4x and others added 3 commits August 31, 2026 09:57
python-foreman 0.4.20 (last release, 2018) builds via autosemver, which
needs pkg_resources - removed in setuptools >= 81. Pin setuptools<81 in
constraints.txt and install with PIP_CONSTRAINT=constraints.txt, which
applies to pip's isolated build environment as well.

Drop the dulwich/autosemver pins that were carried for the same reason,
and add python-cinderclient, which was missing from requirements.txt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- cleanup.py: `regions = regions.append(...)` set regions to None when
  --region was given; call append() without reassigning.
- access.py: drop unused `provision` assignment.
- hypervisor.py: remove dead assignment before `continue`.
- .pylintrc: drop suggestion-mode, disable possibly-used-before-assignment.
- test.sh: skip request_specs.py, which needs the nova package that is
  not in requirements.txt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@trondham

Copy link
Copy Markdown
Contributor

Ser bra ut, men det er endel python-teknisk som jeg ikke føler meg kompetent til å ta stilling til

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants