PyPI deploy provider not allowing deploy of .dev tag?

Hello All,

I’m new at CI and starting to use Travis for it. I’m a Python developer.

My project is hosted at GitHub. What I want to achieve at the end is testing for all commits, deploy at Test PyPI for commits tagged with .dev and deploy to PyPI for commits tagged otherwise.

I am now testing deploy to PYPI, not putting conditions on tags. My .travis.yml file is (skipping comments and like):

language: python

python:
  - "3.5"
  - "3.6"

install: "pip install ."

script:
  - pytest

deploy:
  - provider: pypi
    server: https://test.pypi.org/legacy/
    user: francescor
    password:
      secure: secure
    distributions: "sdist bdist_wheel"
    skip_existing: true

What I get is that after tagging my commit with “0.7.2.dev2”, the deploy job https://travis-ci.org/fricciardi/datetime2/jobs/477768479 ends without deploying, with message “Skipping a deployment with the pypi provider because this branch is not permitted: 0.7.2.dev2”.

It looks to me that the PYPI provider doesn’t like deploy of a .dev version. Am I correct?

If I am, how I can force deploy to PYPI?

Thanks,

Francesco

Please read https://docs.travis-ci.com/user/deployment/#conditional-releases-with-on. By default, the only branch name allowed to deploy is master. If you want t deploy on tags, they need to be explicitly allowed.

Thank you @BanzaiMan.

Thank you for pointing out that I shall have an explicit tags: true condition.

However now Travis does not recognize my commit as tagged (see job here): message at the end of the job log says: “this is not a tagged commit”. To me it looks that commit 1da8734 has tag 0.7.2.dev7, but may be it is not so.

How shall I tag my commits so that the config file works?

Thanks and best regards,

Francesco

https://travis-ci.org/fricciardi/datetime2/jobs/478406476 was a branch build. The tag build was https://travis-ci.org/fricciardi/datetime2/builds/478406432.