stan-dev / pystan

PyStan, a Python interface to Stan, a platform for statistical modeling. Documentation: https://pystan.readthedocs.io
ISC License
342 stars 59 forks source link

Add runtime dependency on setuptools #330

Closed asottile closed 3 years ago

asottile commented 3 years ago

pystan imports pkg_resources (provided by setuptools): https://github.com/stan-dev/pystan/blob/50670e465e13e6d74ea506773eaa36633b5ad4ea/stan/plugins.py#L4

an alternative implementation would be to use importlib.metadata (or the importlib-metadata backport)

riddell-stan commented 3 years ago

Thanks! I missed this.

I gather the right thing to do here is to switch to importlib.metadata.entry_points(), right? We do not need to support older Pythons.

asottile commented 3 years ago

Thanks! I missed this.

I gather the right thing to do here is to switch to importlib.metadata.entry_points(), right? We do not need to support older Pythons.

importlib.metadata is new in python 3.8 so I think the backport would still be needed in 3.7?

riddell-stan commented 3 years ago

Good point. Since we're supporting 3.7 through December, using this fix makes sense.

Just needs a conventional commit style message. Can you prefix the commit summary with "fix: "? (More details: https://pystan.readthedocs.io/en/latest/contributing.html#commit-messages)

asottile commented 3 years ago

Good point. Since we're supporting 3.7 through December, using this fix makes sense.

Just needs a conventional commit style message. Can you prefix the commit summary with "fix: "? (More details: https://pystan.readthedocs.io/en/latest/contributing.html#commit-messages)

I won't because I am personally against the "conventional commits" practice -- feel free to edit my commit

riddell-stan commented 3 years ago

Thanks! Added in 100604ade9649a2d6dc457d1e9f1feef5394ea23