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

Optional dependencies? #40

Closed
andreymal opened this issue Oct 13, 2020 · 1 comment · Fixed by #43
Closed

Optional dependencies? #40

andreymal opened this issue Oct 13, 2020 · 1 comment · Fixed by #43
Labels
good first issue Good for newcomers

Comments

@andreymal
Copy link
Contributor

andreymal commented Oct 13, 2020

I'm not planning on using msgpack/toml/yaml in some small project, but they are always installed because pyserde requires them. As far as I understand the code, their use is isolated in separate submodules, so these dependencies can be safely uninstalled while related submodules are not used. So I suggest making these dependencies optional.

It might look something like this:

requires = [...]
msgpack_requires = ['msgpack']
toml_requires = ['toml']
yaml_requires = ['pyyaml']
# ...
setup(
    # ...
    extras_require={
        'msgpack': msgpack_requires,
        'toml': toml_requires,
        'yaml': yaml_requires,
        'full': msgpack_requires + toml_requires + yaml_requires,
        'test': tests_require,
    },
    # ...
)

Then all dependencies can be installed with something like pip install pyserde[full]

@yukinarit
Copy link
Owner

Hi @andreymal ! Thank you for being interested in pyserde!

I totally agree with you and your code LGTM. Could you make a PR for this if you don't mind? 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants