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

Packaging and dependencies #47

Open
Cheaterman opened this issue Oct 31, 2020 · 3 comments
Open

Packaging and dependencies #47

Cheaterman opened this issue Oct 31, 2020 · 3 comments
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request

Comments

@Cheaterman
Copy link
Contributor

Since #42 we no longer have a hard dependency on pyzbar. I asked the PyPA people how to handle that (possibly with extras) but it doesn't seem like require_extras supports negative requirements (which is what would be ideal here).

The other suggestion was to publish zbarcam as a mostly empty package, with a dependency on zbarcam-pyzbar, and have zbarcam-pyzbar and zbarcam-zbarlight be separate packages on PyPI. That way, if someone cares about the backend, they install the backend-specific package ; if not, they just install zbarcam as usual and get pyzbar as usual.

I'm not sure what you guys feel like would be more correct (and least problematic for existing users), so that's why I opened this issue. Let's discuss :-)

@AndreMiras
Copy link
Collaborator

I think leveraging extras_require is fine. We could make two installations possible:

  • pip install zbarcam[pyzbar]
  • pip install zbarcam[zbarlight]

Having one default backend would indeed be ideal, meaning removing the default if the other is explicitly asked. But I don't think this is currently supported indeed.
So by default we could simply have no backend selected, that's probably fine as long as it's clearly documented in the install process

@AndreMiras AndreMiras added dependencies Pull requests that update a dependency file enhancement New feature or request labels Oct 31, 2020
@Cheaterman
Copy link
Contributor Author

Yeah, I re-thought about it - think SQLAlchemy for instance: it doesn't make any assumption about the kind of DB you're going to be connecting to. If you need to connect to pgsql, you're on your own to install psycopg2 for example. So I feel like the extras option is fine, assuming we fix the Android recipe to depend on pyzbar and the iOS one to depend on zbarlight, or something along those lines? Or maybe we could directly use the extras inside the recipes but I'm not so sure about this?

In any case thanks for your response :-)

@AndreMiras
Copy link
Collaborator

Yeah I think recipes should indeed be adapted later on, but it's a bit independent.
Feel free to make a PR with the extra and we can make a PyPI release after the merge.
Thanks for raising the discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants