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

Add pypi deployment via Travis #3

Merged
merged 1 commit into from
Mar 1, 2018
Merged

Add pypi deployment via Travis #3

merged 1 commit into from
Mar 1, 2018

Conversation

zurk
Copy link
Contributor

@zurk zurk commented Feb 27, 2018

Signed-off-by: Konstantin Slavnov [email protected]

.travis.yml Outdated
jobs:
include:
- stage: build
after_script: skip
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need after_script: skip here?

.travis.yml Outdated
- cd build
- cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0 ..
install:
- . .travis.setup
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better .travis.install

.travis.yml Outdated
- mkdir build
- cd build
- cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0 ..
install:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move it to the "build" stage. I know that not necessary but still will be more explicit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I move it here deploy fails:

subprocess.CalledProcessError: Command '('cmake', '-DCMAKE_BUILD_TYPE=Release', '-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0', '.')' returned non-zero exit status 1
...
auditwheel: command not found
...
twine: command not found
...

and it looks like install does not run for this stage.

See full logs: https://api.travis-ci.org/v3/job/346796133/log.txt

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to debug this because it works perfectly and I did it multiple times, e.g. https://github.com/vmarkovtsev/ggmbox/blob/master/.travis.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but you do not use stages in your example...

@zurk
Copy link
Contributor Author

zurk commented Feb 27, 2018

@vmarkovtsev, Also I find one more problem:

[0K$ twine upload dist/*manylinux* -u $PYPI_LOGIN -p $PYPI_PASS

  0%|          | 0.00/44.2M [00:00<?, ?bytes/s]
100%|█████████▉| 44.1M/44.2M [00:00<00:00, 612kbytes/s]
                                                       
Uploading distributions to https://upload.pypi.org/legacy/
Uploading libMHCUDA-2.0.2-cp34-cp34m-manylinux1_x86_64.whl
HTTPError: 403 Client Error: The user '[secure]' is not allowed to upload to project 'libMHCUDA'. See https://pypi.org/help#project-name for more information. for url: https://upload.pypi.org/legacy/

travis_time:end:1bf1826c:start=1519741115503683766,finish=1519741119985534458,duration=4481850692
�[0Ktravis_fold:end:after_script
�[0K
Done. Your build exited with 0.

in case of error, twine returns the error message instead of 1 code (https://github.com/pypa/twine/blob/master/twine/__main__.py#L27).
I can make a PR to twine, but any ideas how to work around it for now?

@zurk
Copy link
Contributor Author

zurk commented Feb 27, 2018

And this is not outdated. #3 (comment)

.travis.yml Outdated

jobs:
include:
- stage: build
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see much changes...

Also script should run the tests, not install.

And be aware that this project is actually C++. There are python bindings, but there can be other bindings too. Don't nail it to Python.

@vmarkovtsev
Copy link
Collaborator

vmarkovtsev commented Feb 27, 2018

@zurk

dist: trusty
sudo: required

matrix:
  include:
    - language: python
      python:
        - 3.4
        - 3.5
        - 3.6
      env:
        - CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0
      install: . .python.install
      deploy:
        - if tag
        - twine upload dist/*manylinux* -u $PYPI_LOGIN -p $PYPI_PASS
      language: cpp
      install:
        - mkdir build
        - cd build
        - cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0 ..
notifications:
  email: false

@zurk
Copy link
Contributor Author

zurk commented Feb 28, 2018

@vmarkovtsev I adopt your script.
for any reason

python:
  - 3.4
  - 3.5
  - 3.6

does not work at all. and any modifications of this code.
Also, deployment stage fails with gives zero-information message:

[33mInstalling deploy dependencies�[0m

!!! Script support is experimental !!!


travis_fold:end:dpl.1
travis_fold:start:dpl.2
�[33mPreparing deploy�[0m

travis_fold:end:dpl.2
travis_fold:start:dpl.3
�[33mDeploying application�[0m
Script failed with status 127

travis_fold:end:dpl.3
failed to deploy

But It should be the same as I share earlier #3 (comment). You should add PyPI login and password to Travis settings to $PYPI_LOGIN and $PYPI_PASS env vars.

@vmarkovtsev
Copy link
Collaborator

@zurk If setting several python versions do not work - grow the matrix and use YAML pointers to be DRY.

@vmarkovtsev
Copy link
Collaborator

I will add the login and password as soon as we merge this.

@zurk
Copy link
Contributor Author

zurk commented Feb 28, 2018

grow the matrix and use YAML pointers to be DRY.

I think I did exactly what you are saying

.travis.yml Outdated
tags: true
- language: python
python: 3.5
before_install:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need virtualenv in this ephemeral environment, nothing to isolate from. Each job runs in a separate instance.

@vmarkovtsev
Copy link
Collaborator

@zurk Almost there

Signed-off-by: Konstantin Slavnov [email protected]
@zurk
Copy link
Contributor Author

zurk commented Mar 1, 2018

Yes, now it works without virtualenv activation. Before I have some troubles. Looks like artifact while searching how to make it work.

@vmarkovtsev vmarkovtsev merged commit cfba7fd into src-d:master Mar 1, 2018
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.

2 participants