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

Modernise Python packaging #31

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

chrisjsewell
Copy link
Contributor

@chrisjsewell chrisjsewell commented Jan 17, 2023

@ekouts
Copy link
Collaborator

ekouts commented Jan 17, 2023

Hi @chrisjsewell , thanks, both your PRs are very much appreciated. I was about to merge the #29 , which tries to do some of the things you suggest.
I wasn't too sure what is the best choice for packaging and I went for poetry, do you think flit is a better option? If not, maybe we can add the pre-commit hooks that you suggest in a separate PR, after merging #29.
Also regarding the CLI, I went with typer instead of click. Again, if you don't have any argument against it, I will go through your cli and I think I can add the extra functionalities.
What do you think?

@chrisjsewell
Copy link
Contributor Author

I wasn't too sure what is the best choice for packaging and I went for poetry, do you think flit is a better option?

flit is the simplest option essentially, and maintained by the guys at pip, I like it and use it for all my packages. the problem with poetry is that it does not support PEP 621 (python-poetry/roadmap#3) and is bit overcomplicated for my liking

There is also https://github.com/pypa/hatch, but yeh its not the end of the world either way

Definitely adding the pre-commit would be great.
Also adding mypy checking and type annotations would be very helpful also, particularly the return of API calls using https://docs.python.org/3/library/typing.html#typing.TypedDict, as I started to do in #10

and yeh for the CLI, the main thing is that there is one 😅

FYI, what triggered this is that I was mocking up how it would look like to use pyfirecrest with aiida: https://github.com/chrisjsewell/pyfirecrest/blob/aiida_mock/firecrest/mock_calc.py

Especially getting it to all work with asyncio 😄

@ekouts
Copy link
Collaborator

ekouts commented Jan 24, 2023

Just FYI, I have a made a release today with what I have for now but we will try to add your suggestions from your PRs (all three) in the next release. I think they are all good points

@chrisjsewell
Copy link
Contributor Author

I have a made a release today with what I have for now but we will try to add your suggestions from your PRs

yeh no worries, actually I would strongly recommend moving away from poetry and using one of the python standard packaging tools: https://github.com/pypa/flit, https://github.com/pypa/hatch or https://github.com/pdm-project/pdm/

I was playing around with the new release, and poetry makes the developer experience pretty horrible

Also, did you mean to leave the setup.py and requirements.txt files in the repo; these can be removed now no?

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.

None yet

2 participants