Skip to content

Remove conda reqs and requirements-all.txt; simplify CI installs via setup.py extras#916

Merged
ianhelle merged 4 commits into
mainfrom
chore/remove-conda-and-reqs-all
Jul 18, 2026
Merged

Remove conda reqs and requirements-all.txt; simplify CI installs via setup.py extras#916
ianhelle merged 4 commits into
mainfrom
chore/remove-conda-and-reqs-all

Conversation

@ianhelle

Copy link
Copy Markdown
Contributor

Summary

Removes unmaintained/unenforced dependency-tracking artifacts and simplifies CI to use setup.py's existing extras directly, addressing 5 related cleanups:

  1. Removed conda/ directory entirely (conda-reqs*.txt, README.md). These files were only referenced by tests/test_pkg_imports.py::test_conda_reqs — not used by any CI workflow, docs build, or pre-commit hook.
  2. Removed requirements-all.txt. setup.py already defines EXTRAS["all"] (equivalent content) and EXTRAS["test"] (= all + dev extras combined — equivalent to requirements-all.txt + requirements-dev.txt). pip install -e ".[test]" is a drop-in replacement, used to update:
    • .github/workflows/python-package.yml (build + lint jobs) — also fixes a stray doc/requirements-all.txt cache-key typo in the docs job (unrelated to requirements-all.txt at all)
    • azure-pipelines.yml
    • .devcontainer/Dockerfile
    • MANIFEST.in (dropped the include requirements-all.txt line)
  3. Kept tests/test_pkg_imports.py::test_missing_pkgs_req, removed test_conda_reqs (the conda vs. setup.py "package version consistency check").
  4. Along the way, fixed a real bug in tools/toollib/import_analyzer.py::_check_std_lib: stdlib detection only checked sys.prefix, which is wrong for venvs (especially uv-managed ones where the physical stdlib lives under sys.base_prefix, outside the venv prefix). This caused ~60 stdlib modules to be misclassified as missing packages — confirmed the same failure pre-existed on main.
  5. Removed the check_reqs_all pre-commit hook (it auto-rewrote requirements-all.txt — including stripping hand-maintained security-vuln comments — on every commit touching a .py file). tools/create_reqs_all.py is kept and documented as a manual, on-demand generator for anyone who wants a frozen requirements-all.txt locally.

Testing

  • Full pytest suite (MSTICPYCONFIG=tests/msticpyconfig-test.yaml): 1463 passed, 68 skipped, 0 failures (previously 1 failure in test_missing_pkgs_req, now fixed).
  • ruff check, ruff format --check, pydocstyle, pylint all pass on changed Python files.
  • YAML syntax validated for python-package.yml, azure-pipelines.yml, .pre-commit-config.yaml.
  • Confirmed pip install -e ".[test]" resolves cleanly (255 packages) as a drop-in replacement for the old two-file install.

Removes unmaintained/unenforced dependency-tracking artifacts and
simplifies CI to use setup.py's existing extras directly.

- Delete conda/ directory entirely (conda-reqs*.txt, README.md). These
  files were only referenced by tests/test_pkg_imports.py::test_conda_reqs
  and not used by any CI workflow, docs build, or pre-commit hook.
- Delete requirements-all.txt. setup.py already defines EXTRAS['all']
  (equivalent content) and EXTRAS['test'] (= 'all' + 'dev' extras
  combined, equivalent to requirements-all.txt + requirements-dev.txt).
  `pip install -e ".[test]"` is a drop-in replacement.
- Remove 'include requirements-all.txt' from MANIFEST.in.
- Update .github/workflows/python-package.yml (build + lint jobs) and
  azure-pipelines.yml to install via `pip install -e ".[test]"`
  instead of separate requirements-all.txt/requirements-dev.txt steps.
  Also fix a stray doc/requirements-all.txt cache-key typo in the docs
  job (that job only ever used docs/requirements.txt).
- Update .devcontainer/Dockerfile to install msticpy[test] directly
  from GitHub instead of copying/installing requirements-all.txt and
  requirements-dev.txt separately.
- Remove the check_reqs_all local pre-commit hook, which auto-rewrote
  requirements-all.txt (stripping hand-maintained security-vuln
  comments) on every commit touching a .py file.
- Document tools/create_reqs_all.py as a manual, on-demand generator
  for anyone who wants a frozen requirements-all.txt locally (already
  supports --print/--diff/--req-all-path; no code changes needed
  beyond the docstring).
- tests/test_pkg_imports.py: remove test_conda_reqs (the conda vs.
  setup.py 'package version consistency check'); keep and simplify
  test_missing_pkgs_req.
- Fix a real bug in tools/toollib/import_analyzer.py::_check_std_lib:
  stdlib detection only checked sys.prefix, which is wrong for venvs
  (especially uv-managed ones where the physical stdlib lives under
  sys.base_prefix, outside the venv prefix). This caused ~60 stdlib
  modules to be misclassified as missing packages in
  test_missing_pkgs_req on this environment (verified: same failure
  pre-existed on main).
- Fix tools/Module-Analysis.ipynb example cell referencing the now-
  removed requirements-all.txt.

Verified: full pytest suite (MSTICPYCONFIG=tests/msticpyconfig-test.yaml)
passes cleanly - 1463 passed, 68 skipped, 0 failures (previously 1
failure in test_missing_pkgs_req, now fixed). ruff/pylint/pydocstyle
pass on all changed Python files. YAML syntax validated for
python-package.yml, azure-pipelines.yml, and .pre-commit-config.yaml.
Confirmed `pip install -e ".[test]"` resolves cleanly (255 packages)
as a drop-in replacement for the old two-file install.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

ianhelle and others added 3 commits July 18, 2026 10:53
CI was failing on this branch (and on `main` itself - confirmed via
recent CI history, so this is a pre-existing repo-wide break, not
something introduced by this PR):

1. build (all Python versions): azure-mgmt-resource 26.0.0 (released
   2026-06-24) moved ResourceManagementClient from azure.mgmt.resource
   to azure.mgmt.resource.resources, breaking
   msticpy.context.azure.azure_data - and everything that imports it
   (Sentinel context tests, config editors, etc). Capped
   azure-mgmt-resource to <26.0.0 in setup.py's "azure" extra (this
   branch no longer has conda-reqs.txt/requirements-all.txt to update,
   since those were removed - setup.py is now the sole source of
   truth).

2. lint (mypy): mypy 2.3.0 infers its syntax target `python_version`
   from setup.cfg's `python_requires = >=3.10` when not told
   otherwise, rather than the actual interpreter running it. This
   causes a false positive on numpy 2.5.1's stub file, which uses a
   PEP 695 `type` statement (Python 3.12+ only):
     numpy/__init__.pyi:737: error: Type statement is only supported
     in Python 3.12 and greater [syntax]
   Fixed by passing `--python-version ${{ matrix.python-version }}`
   explicitly to mypy in the lint job, so it always checks against the
   actual running Python version.

   Once unblocked, mypy surfaced 6 additional real (pre-existing, but
   previously unreached because mypy aborted early) type errors,
   fixed:
   - 4x try/except `Version` re-import fallback pattern
     (packaging.version.Version -> distutils.version.LooseVersion)
     was tagged `# type: ignore[assignment]` but mypy now reports it
     as `no-redef`; added `no-redef` to the ignore codes in
     msticpy/init/nbinit.py, msticpy/init/azure_ml_tools.py,
     msticpy/init/pivot_core/pivot_magic_core.py, and
     msticpy/analysis/polling_detection.py.
   - msticpy/analysis/eventcluster.py: `color = [0, 0, 0, 1]` assigned
     a list[int] to a variable typed as tuple[float, float, float,
     float] (an RGBA color tuple) - changed to `(0.0, 0.0, 0.0, 1.0)`.
   - msticpy/vis/foliummap.py: `pygeohash = None` in the ImportError
     fallback branch needed `# type: ignore[assignment]` since
     `pygeohash` is otherwise typed as a module.

Verified: full pytest suite (MSTICPYCONFIG=tests/msticpyconfig-test.yaml)
passes - 1463 passed, 68 skipped, 0 failures. `mypy --python-version
3.12/3.13`, ruff, pydocstyle, and pylint (10.00/10) all clean on the
changed files.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Merges PR #915 (dependency bumps + azure-mgmt-resource/mypy CI fixes,
now on main) into this branch. Resolved delete/modify conflicts on
conda/conda-reqs*.txt and requirements-all.txt by keeping their
removal (this branch's purpose).
Bumps msticpy/_version.py from 3.0.1 to 3.0.2 (patch release: security
dependency bumps from #915, CI fixes, and this PR's conda/requirements-all
cleanup - no breaking API changes).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ianhelle
ianhelle merged commit cb71514 into main Jul 18, 2026
11 checks passed
@ianhelle
ianhelle deleted the chore/remove-conda-and-reqs-all branch July 18, 2026 18:48
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.

1 participant