Skip to content

PyPI release 0.0.8 fails with pandas 3; new release needed #46

Open

Description

@1106maxi

Hi all,

The current PyPI release (0.0.8) doesn't work with pandas 3. Because 0.0.8 doesn't cap pandas, a fresh pip install PySensemakr now installs pandas 3, and the README example fails right away with KeyError: 0.

To reproduce, in a fresh environment (Python 3.13):

pip install PySensemakr==0.0.8 "pandas>=3"
import sensemakr as smkr
import statsmodels.formula.api as smf

darfur = smkr.load_darfur()
model = smf.ols("peacefactor ~ directlyharmed + age + farmer_dar + herder_dar + pastvoted + hhsize_darfur + female + village", data=darfur).fit()
smkr.Sensemakr(model=model, treatment="directlyharmed", benchmark_covariates=["female"], kd=[1, 2, 3])
# KeyError: 0

With pandas 2.3 it works, and main already contains the fix (#45). Installed from GitHub, the same example works with pandas 3.1. In total, main has 22 commits since 0.0.8.

Would it be possible to publish a new release from main? As far as I can see, only the PyPI accounts blhill and zhehaoz can upload releases, so @brianhill11 and @KennyZhang-17, this would probably need one of you. Alternatively, adding @nlapier2 and @carloscinelli as maintainers on PyPI would let them release as well.

Related, in case it's useful: the git tags stop at 0.0.3, so versioneer gives main the version 0.0.3+262.g8f88d01, which pip ranks below 0.0.8. As a result, pip install --upgrade PySensemakr on an install from GitHub would replace the newer code from main with the older 0.0.8 release. The PyPI packages record the commits they were built from, so the release tags can be recreated:

git tag 0.0.6 95848698eaf40b29acb3f9f44cb7ce5c9ba6eabb
git tag 0.0.7 5ab0ec8ca3d5cc3de0bc5163823f2086a0fec243
git tag 0.0.8 2bf5cfd0f17936b9dfe5090f03ede53387fe66a3
git push origin 0.0.6 0.0.7 0.0.8

(0.0.4 was never released, and 0.0.5 was built with an uncommitted change, so it has no exact commit to tag.)

Happy to help with any of this!

Thanks,
Maxi

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions