pymeasure / pyleco

Python implementation of the Laboratory Experiment COntrol (LECO) protocol
MIT License
9 stars 3 forks source link

Add uploading CI workflow #30

Closed BenediktBurger closed 8 months ago

BenediktBurger commented 8 months ago

Add a workflow to upload a release to PyPI once it is published.

It requires to add a publisher to PyPI, which seems to be the most recent authentication scheme. @bilderbuchi , could you either add me (https://pypi.org/user/bburger/) as a maintainer to pyleco on pypi, or setup pypi to accept releases from github? This is simply to enter the owner name, the repo name, the file name ("python-publish.yml") and the environment name (not applicable yet).

That will make releases quite simple: Create changelog, make a github release, done.

github-actions[bot] commented 8 months ago

PyLECO Coverage

Coverage Report
FileStmtsMissCoverMissing
pyleco
   test.py1141088%39, 42, 74, 80, 99, 104, 107, 112, 115, 162, 171–>173
pyleco/actors
   actor.py131994%147, 154, 176, 179, 184, 188, 191, 194, 226
pyleco/coordinators
   coordinator.py2411494%467–487
   proxy_server.py715914%58, 72–96, 126–131, 135–177
pyleco/directors
   director.py911285%89–94, 99, 120, 129–131, 141
   starter_director.py30088%51–>53, 62–>64, 73–>75, 84–>86, 95–>97
   transparent_director.py41290%62–>64, 73, 99
pyleco/management
   data_logger.py2221891%46, 213, 285–>exit, 298–>300, 314–319, 370–383
   starter.py1805567%50–51, 65, 67, 70–71, 128–129, 151, 154–162, 166–167, 176–177, 183, 186–188, 194–196, 207–208, 210, 216, 220–221, 224–226, 229–230, 238–239, 265–267, 275, 291–306
pyleco/management/test_tasks
   test_task.py24775%15, 18, 22, 26, 30, 33, 40
pyleco/utils
   communicator.py1492284%94, 113–114, 132–135, 157–>159, 189–>192, 203–204, 208, 219–225, 231–233, 245, 258, 261, 265
   coordinator_utils.py312598%79, 86, 181–182, 316, 363–>exit, 436–>435, 456–>exit
   extended_message_handler.py721772%48, 75–76, 83–85, 89, 92, 98, 119–125, 129, 137
   listener.py72787%82, 121–122, 126, 128, 140, 145–>exit, 152
   parser.py20093%54–>56, 58–>60
   pipe_handler.py1821094%141–>143, 147, 164, 175, 178, 208–209, 214, 250–251, 290
   qt_listener.py35343%27–95
   timers.py16480%53–54, 59–60
   zmq_log_handler.py35481%63, 65–>67, 69–71
TOTAL257928987% 

Coverage Summary

Tests Skipped Failures Errors Time
575 5 :zzz: 0 :x: 0 :fire: 14.641s :stopwatch:
codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (ab7ba64) 86.46% compared to head (bd98319) 86.46%. Report is 1 commits behind head on main.

:exclamation: Current head bd98319 differs from pull request most recent head 8b50a86. Consider uploading reports for the commit 8b50a86 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #30 +/- ## ======================================= Coverage 86.46% 86.46% ======================================= Files 32 32 Lines 2579 2579 Branches 312 312 ======================================= Hits 2230 2230 Misses 289 289 Partials 60 60 ``` | [Flag](https://app.codecov.io/gh/pymeasure/pyleco/pull/30/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymeasure) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/pymeasure/pyleco/pull/30/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymeasure) | `86.46% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymeasure#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

bilderbuchi commented 8 months ago

Add a workflow to upload a release to PyPI once it is published.

It requires to add a publisher to PyPI, which seems to be the most recent authentication scheme. @bilderbuchi , could you either add me (https://pypi.org/user/bburger/) as a maintainer to pyleco on pypi, or setup pypi to accept releases from github? This is simply to enter the owner name, the repo name, the file name ("python-publish.yml") and the environment name (not applicable yet).

I did both those things. Concerning the environment name, pypi says

The name of the GitHub Actions environment that the above workflow uses for publishing. This should be configured under the repository's settings. While not required, a dedicated publishing environment is strongly encouraged, especially if your repository has maintainers with commit access who shouldn't have PyPI publishing access.

So I suggest you configure that environment name as appropriate with your new access, already now.

bilderbuchi commented 8 months ago

Thank you for pushing the state of our build setup here! I imagine this will also be a useful trial for doing the same thing in the pymeasure repo...

BenediktBurger commented 8 months ago

I created a release environment (which requires manual approval by you or me) and made this script use that environment. Pypi will only accept that environment (also to test, that it works as expected, for pymeasure).