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

Add a pyproject.toml and minimal packaging structure #8

Merged
merged 6 commits into from
Mar 7, 2023
Merged

Add a pyproject.toml and minimal packaging structure #8

merged 6 commits into from
Mar 7, 2023

Conversation

FollowTheProcess
Copy link
Contributor

Hey! 👋🏻

Saw this project come up on my GitHub feed and figured it's quick enough for me to help out with some of the issues you've put up.

This PR closes #5

I've put a fairly minimal pyproject.toml in using hatch. I've had to restructure the package slightly to make this work (I'm not sure if single file packages are possible, at least I've never done one). I've gone for ./src layout but let me know if you'd like a different layout!

Also added pytest as a dev dependency with a config I've found useful in my projects. And added an entry point 🙂

Let me know if you'd like any changes or have any other comments 👍🏻

Copy link
Owner

@brettcannon brettcannon left a comment

Choose a reason for hiding this comment

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

The project structure is unfortunately very purposeful, so I can't have this converted into a package; it needs to stay a self-contained file. As such, I don't think having a src layout is helpful and just makes running the tests a little bit harder by requiring an editable install for not benefit.

pyproject.toml Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@brettcannon
Copy link
Owner

Thanks for the PR!

I've put a fairly minimal pyproject.toml in using hatch. I've had to restructure the package slightly to make this work (I'm not sure if single file packages are possible, at least I've never done one). I've gone for ./src layout but let me know if you'd like a different layout!

Unfortunately I need this to stay a single file.

And added an entry point 🙂

Unfortunately I don't want an entry point (see the original issue as to why).

@brettcannon
Copy link
Owner

And FYI Flit supports a single file if Hatch doesn't.

@FollowTheProcess
Copy link
Contributor Author

Thanks for reviewing, no worries leave it with me I'll have another go with your changes 👍🏻

@FollowTheProcess
Copy link
Contributor Author

Looks like hatch supports a single file package out of the box, I did hatch build and unzipped the tarball it looks as if everything is there as expected.

Also noticed you've now added ruff as a linter. I have a fairly strict ruff.toml in my home directory that was making it trigger a load of warnings. I think just including the default ruff config in pyproject.toml should stop that happening for anyone else

Think I addressed all your comments, let me know if you want me to make any further changes 👍🏻

@brettcannon brettcannon self-requested a review March 7, 2023 21:39
@brettcannon
Copy link
Owner

I marked all of the requested changes as resolved and refreshed my review. Unfortunately it looks like the changes you made to microvenv.py aren't formatted with Black. But since this is about to become a blocker for me releasing this project to PyPI, I'm going to override the failure and fix the code up myself.

Thanks for the PR!

@brettcannon brettcannon merged commit 32f3a8d into brettcannon:main Mar 7, 2023
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.

Add a pyproject.toml
2 participants