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

Build and publish python sdist on PyPI #1649

Merged
merged 4 commits into from
Sep 10, 2021
Merged

Conversation

priyanshuone6
Copy link
Member

@priyanshuone6 priyanshuone6 commented Sep 9, 2021

Description

Add a workflow to build and publish PyBaMM's python source distribution on PyPI for Windows (.zip) and Unix (.tar.gz)

@priyanshuone6
Copy link
Member Author

Not sure on how to test this

@codecov
Copy link

codecov bot commented Sep 9, 2021

Codecov Report

Merging #1649 (c8e66da) into main (d14e38b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1649   +/-   ##
=======================================
  Coverage   99.26%   99.26%           
=======================================
  Files         343      343           
  Lines       18677    18677           
=======================================
  Hits        18540    18540           
  Misses        137      137           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d14e38b...c8e66da. Read the comment docs.

@valentinsulzer
Copy link
Member

What's the difference between this and the existing workflow to publish releases?

@priyanshuone6
Copy link
Member Author

A source distribution is basically an archive containing the source code (both Python and C++). In contrast a wheel is what we call a built distribution: it contains the "installed" version of a package - particularly the compiled extension modules.
I talked with @tlestang and he suggested creating a build_sdist.yml that builds the tar.gz and publishes it to PyPI. The tar.gz file published to PyPI will then be used to automatically bump the version on conda-forge/pybamm-feedstock

@valentinsulzer
Copy link
Member

Ok, I don't know how to test this either, I guess @tlestang should review it

@tlestang
Copy link
Contributor

tlestang commented Sep 9, 2021

That all looks very good. @priyanshuone6 to test this, you can trigger this action from your own fork of PyBaMM. The workflow_dispatch at the top of the workflow file entry makes it possible to manually trigger the workflow. When doing so, make sure to choose testpypi to upload the sdist to the test pypi server. you'll need to create an account on test.pypi.org first, and save the token on your fork's secret list.

@priyanshuone6
Copy link
Member Author

@tinosulzer @tlestang
I think it's ready to merge now. You can check the test workflow run here

@priyanshuone6 priyanshuone6 changed the base branch from develop to main September 10, 2021 05:53
@tlestang tlestang merged commit 6dc1335 into pybamm-team:main Sep 10, 2021
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.

3 participants