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 examle PyPI upload example #256

Merged
merged 4 commits into from
Sep 16, 2021
Merged

Conversation

heather999
Copy link
Contributor

@heather999 heather999 commented Sep 13, 2021

IMPORTANT: Please create an issue first before opening a Pull Request.
Linked to issue(s): #255

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

What changes were proposed in this pull request?

Adding new GH Action to automate upload to PyPI for new releases

How was this patch tested?

Has not been tested directly with snmachine yet. Once a new GitHub secret is added, we can see how this workflow functions using the testPyPI to start

Final Checklist:

  • My code follows the style guidelines of this project
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I am up to date with dev branch of snmachine at the time of this PR

@Catarina-Alves
Copy link
Collaborator

@heather999 the PyPI API token was created and the secret has been set with the name PYPI_API_TOKEN. Is there anything else to do, or does it work now?

@heather999
Copy link
Contributor Author

Great! Right now, to trigger this workflow, we need a new release tag on snmachine - and that will cause the workflow to start up. Right now, the workflow is only uploading to testpypi just so we can see this is working as expected.
So - I would just apply a new tag perhaps, v2.0.0-post2 and we can watch and see the workflow start up and make sure it runs correctly.

@Catarina-Alves
Copy link
Collaborator

Oh, I had setup the secret and the API on PyPI and not on TestPyPI. Will that generate any issue?
On a different note, to apply the new tag, do I merge these commits to main and apply the new tag on them?

@heather999
Copy link
Contributor Author

ah yes! :) sorry Ok let me see if I can do a quick test by forking this repo and running this to upload to testpypi. That would make me feel more confident before asking this be merged to master

@heather999
Copy link
Contributor Author

Hi @Catarina-Alves I was able to partially test and fix a small typo. I can't upload to testpypi since I'm not a maintainer on snmachine and that is fine. So I think to move ahead, we can do the following:

  • You do have to create a token in testpypi separate from the token you already created on pypi and save it as a GitHub secret. This is really just to test this out, but I think that is worthwhile. We can temporarily update the secret name in the workflow to TESTPYPI_API_TOKEN
  • Merge this PR to main
  • Add a new tag on this repo, perhaps v2.0.0.dev1 and then hopefully we'll see the build occurs and is uploaded
  • After that, I'll try installing snmachine using pip install from testpypi and just see that it generally works.
  • Then we can move to use PYPI_API_TOKEN, and make a new tag on smachine.

@Catarina-Alves
Copy link
Collaborator

@heather999, the new API token and secret are created. I also updated the secret name in the workflow to TESTPYPI_API_TOKEN.
I just want to confirm that the next step is indeed to merge this PR to main and then add the new tag. No other steps are needed before merging, right?

@heather999
Copy link
Contributor Author

@Catarina-Alves that looks perfect. Yes, the next step is to merge to main and create a new Release tag on snmachine. Then we should see a build start up under the "Actions": https://github.com/LSSTDESC/snmachine/actions

@Catarina-Alves Catarina-Alves merged commit 31fdfb1 into main Sep 16, 2021
@Catarina-Alves
Copy link
Collaborator

@heather999, the new release was successfully uploaded to TestPyPI: https://test.pypi.org/manage/project/snmachine/release/2.0.0.dev0/

@heather999
Copy link
Contributor Author

Thank you @Catarina-Alves I can confirm I was able to install this version from testpypi I just want to run through a couple of your notebooks and see that they generally work. I'll do that in the morning!

@Catarina-Alves
Copy link
Collaborator

@heather999 I just wanted to know if you found any issues, or if snmachine was able to be integrated into desc-python (thus closing issues #255 and LSSTDESC/desc-help#66).

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