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

Fix extras_require specification #143

Closed
wants to merge 1 commit into from

Conversation

mweinelt
Copy link

Otherwise setuptools will now error out with

setuptools.extern.packaging.markers.InvalidMarker: Expected a marker variable or quoted string

Otherwise setuptools will now error out with

> setuptools.extern.packaging.markers.InvalidMarker: Expected a marker variable or quoted string
@git-developer
Copy link
Contributor

@JelmerT This issue currently prevents building an up-to-date Docker image.

The culprit is the empty key in '': ["intelhex"],. Removing the line as proposed in this PR is one option. I see alternatives, though.

As far as I understand from setup.py:

  • intelhex is an optional dependency
  • python-magic is an optional dependency of intelhex
  • intelhex is installed by default; python-magic is not installed by default.

If I understand setuptools#1139 and a discussion about Adding a default extra_require environment right, setuptools doesn't support a dependency that is both optional and installed by default. Thus, I see the following options:

  1. Make intelhex a hard requirement, so that users get intelhex automatically and cannot skip it:

    install_requires=["pyserial", "intelhex"]
    
  2. Do not install intelhex by default so that users explicitely declare the desired dependency by installing one of cc2538-bsl or cc2538-bsl[intelhex] or cc2538-bsl[python-magic]:

    extras_require={
        'intelhex': ["intelhex"],
        'python-magic': ["intelhex", "python-magic"]
    }
    

What do you think?

@JelmerT
Copy link
Owner

JelmerT commented Mar 14, 2024

@mweinelt @git-developer did #159 fix this? I think it's now an in-between your 2 options solution?

@mweinelt
Copy link
Author

Looks good to me.

@mweinelt mweinelt closed this Mar 14, 2024
@mweinelt mweinelt deleted the fix-extras branch March 14, 2024 21:13
@git-developer
Copy link
Contributor

Fixes the broken build, but the behavior is a little bit strange because

  • requirement intelhex triggers package python-magic and
  • requirement cc2538-bsl triggers package intelhex:
$ pip3 install 'cc2538-bsl @ git+https://github.com/JelmerT/cc2538-bsl'
[…]
Installing collected packages: pyserial, cc2538-bsl

$ pip3 install 'cc2538-bsl[intelhex] @ git+https://github.com/JelmerT/cc2538-bsl'
[…]
Installing collected packages: pyserial, python-magic, cc2538-bsl

$ pip3 install 'cc2538-bsl[cc2538-bsl,intelhex] @ git+https://github.com/JelmerT/cc2538-bsl'
[…]
Installing collected packages: pyserial, intelhex, python-magic, cc2538-bsl

I prefer option 2 from above (I can open a PR if you agree).

git-developer added a commit to git-developer/ti-cc-tool that referenced this pull request Mar 15, 2024
@Szewcson
Copy link
Contributor

Szewcson commented Mar 15, 2024

I agree with @git-developer. His proposition seems better then my hotfix. I was focused mainly on fixing issue with missing pyproject.toml and making package installable.

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

Successfully merging this pull request may close these issues.

4 participants