# CircleCI Configuration file

machine:
  python:
      version: 2.7.11

general:
  artifacts:
     - "dist"

dependencies:
  override:
    - pip install tox tox-pyenv
    - pyenv local 2.7.11 3.5.2  # Should correspond to pre-installed Python versions on CircleCI

test:
  override:
     - tox

deployment:
  pypi:
    # tag: /[0-9]+(\.[0-9]+)*/
    branch: master
    owner: floydhub
    commands:
      - echo "[distutils]" > ~/.pypirc
      - echo "index-servers =" >> ~/.pypirc
      - echo "    pypi" >> ~/.pypirc
      - echo >> ~/.pypirc
      - echo "[pypi]" >> ~/.pypirc
      - echo "username:$PYPI_USERNAME" >> ~/.pypirc
      - echo "password:$PYPI_PASSWORD" >> ~/.pypirc
      - echo >> ~/.pypirc
      - python setup.py register -r pypi
      - python setup.py sdist upload -r pypi

# CircleCI Configuration file

machine:
  python:
      version: 2.7.11

general:
  artifacts:
     - "dist"

dependencies:
  override:
    - pip install tox tox-pyenv
    - pyenv local 2.7.11 3.5.2  # Should correspond to pre-installed Python versions on CircleCI

test:
  override:
     - tox

deployment:
  pypi:
    branch: /release.*/
    owner: floydhub
    commands:
      - echo "[distutils]" > ~/.pypirc
      - echo "index-servers =" >> ~/.pypirc
      - echo "    pypi" >> ~/.pypirc
      - echo >> ~/.pypirc
      - echo "[pypi]" >> ~/.pypirc
      - echo "username:$PYPI_USERNAME" >> ~/.pypirc
      - echo "password:$PYPI_PASSWORD" >> ~/.pypirc
      - echo >> ~/.pypirc
      - python setup.py register -r pypi
      - python setup.py sdist upload -r pypi

Deploy to pypi from release branches only
Deploy to pypi from release branches only
