You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Upgrade to pyproject.toml and pypa/gh-action-pypi-publish #6
Activity
simonw commentedon Jan 16, 2024
Tried the in-development version of this to build
datasette-test:This worked:
pip install -e '.[test]'The
publish.ymllooked like this:Compare with this one which I know works: https://github.com/datasette/datasette-build/blob/02e612b667aaa0bc07da24c81023fa6b97d6c270/.github/workflows/publish.yml
Diff here: https://gist.github.com/simonw/968f85a24fead6bf814622b5390d7124/revisions
I think it's going to work. I'm going to risk committing this here, then test it live.
Upgrade for pyproject.toml and pypa/gh-action-pypi-publish, refs #6
simonw commentedon Jan 16, 2024
Annoying: https://github.com/simonw/python-lib/actions/runs/7546633197/job/20544794655
I think I can fix that by manually editing that workflow myself.
Manually update publish.yml
Show git diff
simonw commentedon Jan 16, 2024
Yeah I need to run this manually on my own laptop to help solve this:
Updates, refs simonw/python-lib#6 (comment)
simonw commentedon Jan 16, 2024
Forgot to add pyproject.toml, refs simonw/python-lib#6
Add pyproject.toml, remove setup.py - refs #6
simonw commentedon Jan 16, 2024
That seemed to work - here's the new example output, which passes its tests: https://github.com/simonw/python-lib-template-demo/tree/8ca44689
And here's the full diff simonw/python-lib-template-demo@f417323...8ca4468
simonw commentedon Jan 16, 2024
Next test: use https://github.com/new?template_name=python-lib-template-repository&template_owner=simonw to create a
datasette-testpackage and then ship it!Initial library structure
simonw commentedon Jan 16, 2024
OK, that created this: https://github.com/datasette/datasette-test/tree/8d5f8262dc3a88f3c6d97f0cef3b55264cabc695
9 remaining items
simonw commentedon Jan 16, 2024
I'm going to ship 0.1 of
datasette/datasette-testto see if the publish workflow works.simonw commentedon Jan 16, 2024
Trying that with a Trusted Publisher:
simonw commentedon Jan 16, 2024
https://github.com/datasette/datasette-test/actions/runs/7547266249/job/20546831786 it worked!
https://pypi.org/project/datasette-test/0.1/ was released by the new template.
simonw commentedon Jan 16, 2024
There's one sharp edge left: the tests fail the first time the repository is cloned from the template: simonw/python-lib-issue-6@54887b2
https://github.com/simonw/python-lib-issue-6/actions/runs/7547200692/job/20546630262 failed:
Placeholderpyproject.toml
simonw commentedon Jan 16, 2024
It doesn't like that there are no tests.
Only run pytest if tests exist
simonw commentedon Jan 16, 2024
One more test: https://github.com/simonw/python-lib-issues-6-demo-2
Tests now pass on initial commit: simonw/python-lib-issues-6-demo-2@73d216e
simonw commentedon Jan 16, 2024
The
setup.pydid show some warnings: https://github.com/simonw/python-lib-issues-6-demo-2/actions/runs/7547373090Upgrade action versions in setup.yml
simonw commentedon Jan 16, 2024
I'll use that to create a new test repo, check for no errors, then delete that repo.
simonw commentedon Jan 16, 2024
Yes, that worked - I added whitespace to the
tests/*.pyfile too to make sure the tests passed.simonw commentedon Jan 16, 2024
This is done!
One last thing: I'm going to update the documentation on https://github.com/simonw/python-lib to remind me how to update the template in the future.
simonw commentedon Jan 16, 2024
That documentation is here: https://github.com/simonw/python-lib/blob/main/README.md#notes-on-updating-this-cookiecutter-template