SciKit-Surgery / scikit-surgery

SciKit-Surgery - Compact Libraries for Surgical Navigation
http://scikit-surgery.github.io/scikit-surgery/
Other
39 stars 11 forks source link

Add CI step to push to PyPI #23

Closed thompson318 closed 4 years ago

thompson318 commented 4 years ago

In GitLab by @ThomasDowrick on Nov 16, 2018, 13:27

This can be a manual option in the pipeline, and only avaialable when a tagged version has been pushed to master.

Tom Doel provided this sample code below. $PYPI_USER and $PYPI_PASS need to be store as gitlab variables.

deploy pip to production:
  stage: deploy
  when: manual
  only:
    - tags
  environment:
    name: PyPI
    url: https://pypi.python.org/pypi/PROJECT-NAME
  tags:
    - pip-production
  artifacts:
    paths:
    - dist/
  script:
    # remove any previous distribution files
    - rm -rf dist

    # bundle installer
    - python setup.py bdist_wheel

    # Upload to testpypi server
    - twine upload --repository pypi dist/* --username $PYPI_USER --password $PYPI_PASS
thompson318 commented 4 years ago

In GitLab by @ThomasDowrick on Nov 16, 2018, 13:28

changed the description

thompson318 commented 4 years ago

In GitLab by @ThomasDowrick on Nov 16, 2018, 13:29

changed the description

thompson318 commented 4 years ago

In GitLab by @ThomasDowrick on Nov 19, 2018, 17:24

I've got this up and running for sckit-surgeryimage. If a commit is tagged, then the CI Pipeline will have a manual step to deploy to PyPI.

I've also updated the Wiki page with some more info: https://weisslab.cs.ucl.ac.uk/WEISS/PlatformManagement/SNAPPY/wikis/pushing-package-to-pypi

Do we want to make this part of PythonTemplate, or implement it manually for projects that need it?

@MattClarkson @StephenThompson Any further thoughts, or can we close this now?

thompson318 commented 4 years ago

In GitLab by @MattClarkson on Nov 20, 2018, 05:00

assigned to @ThomasDowrick

thompson318 commented 4 years ago

In GitLab by @MattClarkson on Nov 20, 2018, 05:01

Please can we add it to Python Template?

THanks

thompson318 commented 4 years ago

In GitLab by @StephenThompson on Nov 20, 2018, 09:03

Yes, I agree it would be good to add it to the template.

thompson318 commented 4 years ago

In GitLab by @ThomasDowrick on Nov 20, 2018, 17:22

I have added this to the template (https://weisslab.cs.ucl.ac.uk/WEISS/SoftwareRepositories/PythonTemplate/commit/00eec0ff6dac0cc2e9077173e526da57373756d1) and tested it in a new cookiecutter project.

Until we move the software packages into a single Group, it is necessary to manually set the PYPI_USER and PYPI_PASS variables for any new projects, otherwise the deploy stage will fail on an authentication error.

thompson318 commented 4 years ago

In GitLab by @ThomasDowrick on Nov 20, 2018, 17:22

closed