Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odclib as an optional dependency #38

Open
juntyr opened this issue Feb 27, 2025 · 0 comments
Open

odclib as an optional dependency #38

juntyr opened this issue Feb 27, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@juntyr
Copy link

juntyr commented Feb 27, 2025

Is your feature request related to a problem? Please describe.

pyodc contains both the pure Python pyodc and the extension codc packages. Since v1.6.0, pyodc now depends (unconditionally) on the odclib package, which is only required for codc.

Describe the solution you'd like

odclib should be made an optional dependency so that one can install the wheel from PyPi

Describe alternatives you've considered

It would be even better to package pyodc and codc separately so that pyodc can be installed without ever requiring odclib, and installing codc always requires installing odclib.

Since many end users have the following code (or variations of it):

try:
    import codc as odc
except:
    import pyodc as odc

one could also unify both in a new odc package that just exports everything from either codc or pyodc. This package could then have an optional dependency on codc.

Several other projects that have both a pure Python implementation and a faster C implementation usually just publish one package that uses the C path if available and otherwise falls back to the pure Python one silently (or perhaps with a warning or log message) so that the end user doesn't need to handle the switch.

Additional context

No response

Organisation

University of Helsinki

@juntyr juntyr added the enhancement New feature or request label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant