Skip to content

Default settings for development do not work nicely with pypi #217

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

Closed
Letme opened this issue Mar 5, 2018 · 10 comments
Closed

Default settings for development do not work nicely with pypi #217

Letme opened this issue Mar 5, 2018 · 10 comments
Labels

Comments

@Letme
Copy link

Letme commented Mar 5, 2018

I have a simple project and the deployment to test-pypi is done via .travis-ci.yml for each commit on master branch. The problem is the below error and after reading the documentation couple of times is that I do not know how to switch to SimVer.

Probably my question is more in line of how to make this pypi compatible (what to add into setup.py) as the default is just not working for non-tagged deployment.

Error from travis-ci:

HTTPError: 400 Client Error: '0.0.11.dev14+g0f7c142' is an invalid value for Version. Error: Cannot use PEP 440 local versions. see https://packaging.python.org/specifications/core-metadata for url: https://test.pypi.org/legacy/
@RonnyPfannschmidt
Copy link
Contributor

pypi rejects local versions by design, and setuptools_scm explots that fact in a way (preventing the uploading of randomc scm versions to pypi as a stopgap in release processes)

if you want to work that in more detail you can either reconfigure setuptools_scm in setup.py to stop protecting you from that or you can alter the pypi deployment to set up a env varible in SETUPTOOLS_SCM_PRETEND_VERSION

@Letme
Copy link
Author

Letme commented Mar 5, 2018

Can you point me to how to reconfigure setuptools_scm in setup.py to stop protecting me from that?

@RonnyPfannschmidt
Copy link
Contributor

RonnyPfannschmidt commented Mar 5, 2018

for example you can use local_scheme of https://github.com/pypa/setuptools_scm#configuration-parameters and set it to 'dirty-tag'

aka

setup(
   ...,
   use_scm_version = {'local_scheme':'dirty-tag'},
   ...,
)```

@RonnyPfannschmidt
Copy link
Contributor

note, i suggest to only set that on travis in order to prevent personal mistakes in the release process

@Letme
Copy link
Author

Letme commented Mar 5, 2018

If I use SETUP_TOOLS_SCM_PRETEND_VERSION, then I can probably use it in master only and let default stay for the tags?

Then something like {next_version}.dev{distance} would work correct?

@Letme
Copy link
Author

Letme commented Mar 5, 2018

That fits nicely with your note as well (since otherwise I have to pipe in some stuff in travis)

@RonnyPfannschmidt
Copy link
Contributor

off hand no idea, i usually use the default setup, and upload dev releases to a devpi instance

@brainwane
Copy link

Is this the sort of information that should go into pypi/warehouse#3153?

@RonnyPfannschmidt
Copy link
Contributor

@brainwane possibly

@RonnyPfannschmidt
Copy link
Contributor

closing this one as not actionable, the defaults are intentionally not upload friendly and can be configured away with a different sceme

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

No branches or pull requests

3 participants