Skip to content

MAINT: Fix packaging metadata and align the dependency files - #757

Merged
bashtage merged 6 commits into
mainfrom
lm71-pkg1-packaging
Oct 12, 2026
Merged

bashtage merged 6 commits into
mainfrom
lm71-pkg1-packaging

Conversation

@bashtage

Copy link
Copy Markdown
Owner

Correct the metadata that is published to PyPI, and make pyproject.toml,
requirements*.txt and meson.build agree for the 7.1 release. No minimum
version rises, except that statsmodels 0.13.1 replaces 0.13.0.

pyproject.toml

  • Fix the dev extra, which listed "pandas-stubsl". That name does not exist
    on PyPI, so "pip install linearmodels[dev]" failed.
  • Add Python 3.14 and 3.15 to the classifiers. requires-python is unchanged.
  • Require statsmodels>=0.13.1. 0.13.0 has no wheel for Python 3.10, and
    0.13.1 is the version that the CI job for the minimum versions tests.
  • Add packaging to the dependencies. linearmodels.compat imports it at run
    time, and it only arrived through statsmodels.
  • Use pytest>=9,<10 in the test and dev extras, as requirements-test.txt
    already does, and set minversion to 9.0. pyproject.toml is installed with
    the package, so this also applies to linearmodels.test(), which now stops
    with an error that asks for pytest 9.0 when it is run with pytest 8.
  • Use --strict-markers in addopts, and drop the filterwarnings entry for
    the warning that --strict raised in pytest 8. In pytest 9, --strict is no
    longer an alias: it enables strict_config, strict_markers, strict_xfail
    and strict_parametrization_ids. Markers and xfail are still checked
    (xfail_strict is set), but unknown configuration options and duplicate
    parametrization ids no longer fail the tests.
  • Clean up the doc extra. setuptools_scm is >=9.2.0,<10 as in the build
    system. Remove oldest-supported-numpy, patsy, which linearmodels does not
    use, and the stale pandas~=2.3.3 pin. Remove the second entries for ipython,
    sphinx-immaterial and sphinx-autodoc-typehints.
  • Remove [tool.setuptools_scm]. It was copied from arch and named
    arch/_version.py. Nothing reads it: meson.build gets the version from
    linearmodels/_build/git_version.py, which calls setuptools_scm.get_version
    with explicit arguments, and that function does not read pyproject.toml.
    git_version.py returns the same version with and without the table.
  • Turn the mypy tables for linearmodels.conftest and linearmodels._version
    into [[tool.mypy.overrides]]. pyproject.toml ignores them as written, since
    they use INI syntax. Change the module of the override for the tests from
    "mypy-linearmodels.tests.", which is not a valid pattern, to
    "linearmodels.tests.*". mypy reports the same 65 errors in the same 10 files
    as before.

Other files

  • requirements.txt: match pyproject.toml, with formulaic>=1.2.1 (not 1.0.2),
    statsmodels>=0.13.1 and packaging. Remove wrapt!=2.0.0rc3. It excluded a
    release candidate of wrapt, which formulaic depends on and linearmodels
    does not import, in a commit that gave no reason (5497ece). wrapt
    2.0.0rc4 and 2.0.0 have been released since.
  • meson.build, requirements-dev.txt, the dev extra: use the Cython minimum of
    the build system, 3.0.13, instead of 3.0.10. There is no Cython 3.0.13:
    3.0.12 is followed by 3.1.0. In practice, this means Cython 3.1 or later.
  • requirements-dev.txt: use setuptools_scm>=9.2.0,<10, as the build system
    does (it had <9), and pytest>=9,<10.

Correct the metadata that is published to PyPI, and make pyproject.toml,
requirements*.txt and meson.build agree for the 7.1 release. No minimum
version rises, except that statsmodels 0.13.1 replaces 0.13.0.

pyproject.toml
- Fix the dev extra, which listed "pandas-stubsl". That name does not exist
  on PyPI, so "pip install linearmodels[dev]" failed.
- Add Python 3.14 and 3.15 to the classifiers. requires-python is unchanged.
- Require statsmodels>=0.13.1. 0.13.0 has no wheel for Python 3.10, and
  0.13.1 is the version that the CI job for the minimum versions tests.
- Add packaging to the dependencies. linearmodels.compat imports it at run
  time, and it only arrived through statsmodels.
- Use pytest>=9,<10 in the test and dev extras, as requirements-test.txt
  already does, and set minversion to 9.0. pyproject.toml is installed with
  the package, so this also applies to linearmodels.test(), which now stops
  with an error that asks for pytest 9.0 when it is run with pytest 8.
- Use --strict-markers in addopts, and drop the filterwarnings entry for
  the warning that --strict raised in pytest 8. In pytest 9, --strict is no
  longer an alias: it enables strict_config, strict_markers, strict_xfail
  and strict_parametrization_ids. Markers and xfail are still checked
  (xfail_strict is set), but unknown configuration options and duplicate
  parametrization ids no longer fail the tests.
- Clean up the doc extra. setuptools_scm is >=9.2.0,<10 as in the build
  system. Remove oldest-supported-numpy, patsy, which linearmodels does not
  use, and the stale pandas~=2.3.3 pin. Remove the second entries for ipython,
  sphinx-immaterial and sphinx-autodoc-typehints.
- Remove [tool.setuptools_scm]. It was copied from arch and named
  arch/_version.py. Nothing reads it: meson.build gets the version from
  linearmodels/_build/git_version.py, which calls setuptools_scm.get_version
  with explicit arguments, and that function does not read pyproject.toml.
  git_version.py returns the same version with and without the table.
- Turn the mypy tables for linearmodels.conftest and linearmodels._version
  into [[tool.mypy.overrides]]. pyproject.toml ignores them as written, since
  they use INI syntax. Change the module of the override for the tests from
  "mypy-linearmodels.tests.", which is not a valid pattern, to
  "linearmodels.tests.*". mypy reports the same 65 errors in the same 10 files
  as before.

Other files
- requirements.txt: match pyproject.toml, with formulaic>=1.2.1 (not 1.0.2),
  statsmodels>=0.13.1 and packaging. Remove wrapt!=2.0.0rc3. It excluded a
  release candidate of wrapt, which formulaic depends on and linearmodels
  does not import, in a commit that gave no reason (5497ece). wrapt
  2.0.0rc4 and 2.0.0 have been released since.
- meson.build, requirements-dev.txt, the dev extra: use the Cython minimum of
  the build system, 3.0.13, instead of 3.0.10. There is no Cython 3.0.13:
  3.0.12 is followed by 3.1.0. In practice, this means Cython 3.1 or later.
- requirements-dev.txt: use setuptools_scm>=9.2.0,<10, as the build system
  does (it had <9), and pytest>=9,<10.
- List JIVE, the first-stage rank tests (Cragg-Donald and Kleibergen-Paap),
  the Hausman test and the Pesaran CD test in the feature list. Also list
  random effects, which was missing.
- Say that 7.1 is the last release that supports Python 3.10 and NumPy < 2.
- Make the requirements match pyproject.toml: NumPy 1.22.3, formulaic 1.2.1
  (the README said 1.0.0), pyhdfe, mypy_extensions and packaging. Cython
  3.0.13 (the README said 3.0.10) moves to a new list of the requirements to
  build from source, and the tests need pytest 9.
- Rename "Installing" to "Installation". It said to run setup, which no longer
  exists. Describe the build with meson-python and the editable install used
  for development instead.
- Say that GitHub Actions builds the documentation, not doctr.
- Remove the sentence in "Plan and status" that said that the package should
  eventually add panel regression and that only the single variable IV
  estimators are polished.
- Write pytest instead of py.test.
Add SECURITY.md:
- Only the latest release (7.1.x) is supported.
- Vulnerabilities are reported privately through GitHub private vulnerability
  reporting. If that cannot be used, they are reported by email to the
  maintainer, using the address in pyproject.toml. They are never reported in
  a public issue.
- What a report should contain.
- Responses are best effort, since linearmodels is a volunteer project.

Private vulnerability reporting must be enabled in the repository settings
(Settings, Code security) for the link to work. See #693, where a researcher
asked for a private channel to report a vulnerability.
linearmodels.test() cannot collect 12 test modules (11 of the panel tests and
iv/test_results.py) without xarray, since they import
linearmodels/tests/panel/_utility.py, which imports it unconditionally.
Installing the sdist in a clean environment with
"pip install linearmodels[test]" and running linearmodels.test() ended with
12 collection errors, "No module named 'xarray'". CI does not show this
because it installs requirements-test.txt, which includes xarray.

Use xarray>=0.16, the minimum of the dev extra and the README.
Two corrections to the previous packaging commits.

pytest
- Replace addopts = "--strict-markers" with strict = true. In pytest 9
  (minversion is 9.0), strict enables strict_config, strict_markers,
  strict_xfail and strict_parametrization_ids. That is what --strict did
  with pytest 9, and the tests comply with it (656d1e7 made the
  parametrization ids unique), so this keeps the checks. An unknown
  configuration option, a duplicate parametrization id, an unregistered
  marker and an xfail test that passes are all errors again.
  --strict-markers only checked the markers. xfail_strict stays as it is.

Cython
- There is no Cython 3.0.13: 3.0.12 is followed by 3.1.0. A requirement of
  cython>=3.0.13 already meant Cython 3.1.0 or later, so name that minimum
  in [build-system], the doc and dev extras, requirements-dev.txt, the check
  in meson.build and its error message, and the README. Cython 3.0.12 is
  rejected by meson.build, and Cython 3.1.0 builds linearmodels (checked with
  numpy 2.0.0 and setuptools_scm 9.2.0 on Python 3.10).
The numpydoc lint reads its configuration from [tool.numpydoc_validation].
Its exclude_files setting, which is used to skip files such as the tests, was
added in numpydoc 1.10. Older releases do not support it (it is not in
numpydoc 1.8 or 1.9), so the setting would have no effect with them.

- doc extra: numpydoc>=1.10 (it was >=1.0.0).
- dev extra: add numpydoc>=1.10.
- requirements-dev.txt: numpydoc>=1.10 (it was not pinned).

numpydoc 1.10 requires Python 3.10 or later, the minimum of linearmodels.
"pip install --dry-run" resolves ".[doc]" and ".[dev]" to numpydoc 1.11.0 on
Python 3.10 and 3.14.
@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.58%. Comparing base (208845b) to head (3f82f71).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #757   +/-   ##
=======================================
  Coverage   99.58%   99.58%           
=======================================
  Files         110      110           
  Lines       20328    20328           
  Branches     1600     1600           
=======================================
  Hits        20244    20244           
  Misses         31       31           
  Partials       53       53           
Flag Coverage Δ
adder 99.57% <ø> (ø)
subtractor 99.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bashtage
bashtage merged commit f990adc into main Oct 12, 2026
20 checks passed
@bashtage
bashtage deleted the lm71-pkg1-packaging branch October 12, 2026 09:21
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