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

Use setuptools_scm to determine the version #151

Merged
merged 1 commit into from Nov 1, 2020

Conversation

lpsinger
Copy link
Contributor

This fixes an issue where cffi was required to build a wheel:

$ python setup.py bdist_wheel
Traceback (most recent call last):
  File "setup.py", line 6, in <module>
    exec(open("mip/constants.py").read(), version_dict)
  File "<string>", line 4, in <module>
ModuleNotFoundError: No module named 'cffi'

It should also streamline the process of making a release a tiny bit.

@lpsinger lpsinger force-pushed the setuptools-scm branch 3 times, most recently from ec9713d to 91b84e4 Compare October 23, 2020 17:20
@h-g-s
Copy link
Contributor

h-g-s commented Oct 25, 2020

Hi @lpsinger , sorry my ignorance, how do I inform the version with setuptools_scm , i.e., before releasing a new version ?

@lpsinger
Copy link
Contributor Author

Just create a git tag. When you build your release (with python setup.py bdist_wheel, pip wheel, or whatever you do), setuptools_scm will detect the tag and use that as the version.

This fixes an issue where cffi was required to build a wheel:

    $ python setup.py bdist_wheel
    Traceback (most recent call last):
      File "setup.py", line 6, in <module>
        exec(open("mip/constants.py").read(), version_dict)
      File "<string>", line 4, in <module>
    ModuleNotFoundError: No module named 'cffi'

It should also streamline the process of making a release a tiny bit.
@lpsinger
Copy link
Contributor Author

lpsinger commented Nov 1, 2020

Any update on this? The false cffi build-time dependency is causing some installation issues with certain virtual environment tools (e.g. poetry).

@h-g-s h-g-s merged commit 25ed1e7 into coin-or:master Nov 1, 2020
@lpsinger
Copy link
Contributor Author

lpsinger commented Nov 1, 2020

Thank you!

@lpsinger lpsinger deleted the setuptools-scm branch November 1, 2020 23:23
@h-g-s
Copy link
Contributor

h-g-s commented Nov 22, 2020

Hi @lpsinger , just tagged version 1.13.0 , the version appears as

1.13.1.dev0+gc7c8d6b.d20201122

Could this string be trimmed ? Or it is a good practice to include these additional details ? (for me they do not seem to be relevant)

Cheers

@h-g-s
Copy link
Contributor

h-g-s commented Nov 22, 2020

Ops, the problem is bigger than I thought, the string is not accepted as a valid version

HTTPError: 400 Bad Request from https://upload.pypi.org/legacy/
'1.13.1.dev0+gc7c8d6b.d20201122' is an invalid value for Version. Error: Can't use PEP 440 local versions. See https://packaging.python.org/specifications/core-metadata for more information.

@lpsinger
Copy link
Contributor Author

1.13.1.dev0+gc7c8d6b.d20201122

It looks like you made a tarball before tagging.

@h-g-s
Copy link
Contributor

h-g-s commented Nov 23, 2020

worked, thanks !

pabloazurduy pushed a commit that referenced this pull request Mar 1, 2021
This fixes an issue where cffi was required to build a wheel:

    $ python setup.py bdist_wheel
    Traceback (most recent call last):
      File "setup.py", line 6, in <module>
        exec(open("mip/constants.py").read(), version_dict)
      File "<string>", line 4, in <module>
    ModuleNotFoundError: No module named 'cffi'

It should also streamline the process of making a release a tiny bit.
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.

None yet

2 participants