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

Use Poetry for dependency management #431

Merged
merged 6 commits into from
Jul 16, 2023
Merged

Use Poetry for dependency management #431

merged 6 commits into from
Jul 16, 2023

Conversation

george-zubrienko
Copy link
Collaborator

Part of #413

Scope

  • Removed manual publish scripts and pipfile
  • Removed setup.py
  • Added poetry-style toml file and dependency lockfile to ensure contributors can start up with poetry install
  • Updated all pipelines to use Poetry

@george-zubrienko george-zubrienko mentioned this pull request Jun 30, 2023
6 tasks
@github-actions
Copy link

github-actions bot commented Jun 30, 2023

Coverage

Coverage Report
FileStmtsMissCoverMissing
dataclasses_json
   cfg.py51492%77, 81–83
   core.py231996%38–41, 51, 64, 66, 81, 83, 169
   mm.py1892985%33–36, 42–45, 53–56, 62–65, 88, 152–153, 158, 162, 166, 171, 175, 179, 187, 193, 198, 207, 212, 217, 235–242
   stringcase.py25388%59, 76, 97
   undefined.py143299%24, 38
   utils.py1283176%11–24, 44–49, 60–64, 74, 77, 80, 99–100, 108–109, 158, 177, 202
tests
   entities.py220299%229, 235
   test_annotations.py814248%50–67, 78–102, 106–122
   test_api.py142299%139–140
   test_str_subclass.py22195%9
TOTAL240612595% 

Tests Skipped Failures Errors Time
281 1 💤 0 ❌ 0 🔥 3.787s ⏱️

lidatong
lidatong previously approved these changes Jun 30, 2023
Copy link
Owner

@lidatong lidatong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for doing this. Does pyproject.toml replacing all the existing build file formats (pipenv, conda, poetry, requirements.txt) stay compatible for users?

@george-zubrienko
Copy link
Collaborator Author

Awesome! Thanks for doing this. Does pyproject.toml replacing all the existing build file formats (pipenv, conda, poetry, requirements.txt) stay compatible for users?

Should be, according to https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#declaring-project-metadata :)

Requirements can be exported into requirements.txt for pip install with https://python-poetry.org/docs/cli/#export

@george-zubrienko
Copy link
Collaborator Author

Forgot to add commit tagging workflow - will do that, update contributor section in README and then merge.
So release process will include one more step - pre-release part, to create tagged commit and a gh release accordingly.

@george-zubrienko
Copy link
Collaborator Author

@lidatong sorry for the delay, please have a look at this commit

It adds a workflow to create github release/tagged commit, so we can create releases regularly. Finally, I've modified the pythonpackage.yaml to replace version numbers from git tag so we release correct version from that flow :)

@lidatong
Copy link
Owner

@lidatong sorry for the delay, please have a look at this commit

It adds a workflow to create github release/tagged commit, so we can create releases regularly. Finally, I've modified the pythonpackage.yaml to replace version numbers from git tag so we release correct version from that flow :)

looks good thanks for making the automation better with the semver tagging! would this still work with trusted publishing? i saw the workflow is now directly running poetry publish instead of using the pypa gh action

@george-zubrienko
Copy link
Collaborator Author

george-zubrienko commented Jul 12, 2023

@lidatong sorry for the delay, please have a look at this commit
It adds a workflow to create github release/tagged commit, so we can create releases regularly. Finally, I've modified the pythonpackage.yaml to replace version numbers from git tag so we release correct version from that flow :)

looks good thanks for making the automation better with the semver tagging! would this still work with trusted publishing? i saw the workflow is now directly running poetry publish instead of using the pypa gh action

Yeah it should work, poetry publish is basically the same as pypa gh action - but if you want we can test on one of our OSS repos first

@george-zubrienko
Copy link
Collaborator Author

Actually, we can also just do the poetry publish and publish with pypa - I think that would work 200% - will update tomorrow

@george-zubrienko
Copy link
Collaborator Author

@lidatong updated, just to make sure, this is the result of poetry build:

> ~/PycharmProjects/dataclasses-json$ poetry build
Building dataclasses-json (0.0.0)
  - Building sdist
  - Built dataclasses_json-0.0.0.tar.gz
  - Building wheel
  - Built dataclasses_json-0.0.0-py3-none-any.whl
> ~/PycharmProjects/dataclasses-json$ ls
LICENSE  README.md  dataclasses_json  dist  poetry.lock  pyproject.toml  tests  venv
> ~/PycharmProjects/dataclasses-json$ ls dist/
dataclasses_json-0.0.0-py3-none-any.whl  dataclasses_json-0.0.0.tar.gz

Copy link
Owner

@lidatong lidatong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lidatong updated, just to make sure, this is the result of poetry build:

> ~/PycharmProjects/dataclasses-json$ poetry build
Building dataclasses-json (0.0.0)
  - Building sdist
  - Built dataclasses_json-0.0.0.tar.gz
  - Building wheel
  - Built dataclasses_json-0.0.0-py3-none-any.whl
> ~/PycharmProjects/dataclasses-json$ ls
LICENSE  README.md  dataclasses_json  dist  poetry.lock  pyproject.toml  tests  venv
> ~/PycharmProjects/dataclasses-json$ ls dist/
dataclasses_json-0.0.0-py3-none-any.whl  dataclasses_json-0.0.0.tar.gz

ok great, this looks good! we can keep trusted publishing this way. thanks again for the nice CI improvements :D

@george-zubrienko george-zubrienko merged commit 094f074 into master Jul 16, 2023
7 checks passed
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