Open orrp opened 7 months ago
If these additions aren't useful for your use cases feel free to close this issue and I'll just keep these changes in my own fork, no worries! Thanks once again :)
Sorry for not responding to this sooner! These look like good changes. I do usually eventually end up putting a setup.py
in place when I'm ready to publish a project but it's nice to have it from the beginning. Do you recommend not using requirements.txt
and doing pip install -e .
or something?
No worries!
I would use the existing pyproject.toml
, which supersedes setup.py
(see the dependencies
line in the sample above). I never have requirements.txt
in my projects, unless I explicitly need a flow for quickly setting up a package on, say, a specific AWS configuration.
Makes sense! How do you install dependencies locally during development? And do you have thoughts on where to put development-only dependencies like black, mypy, etc.?
I use pip install -e .
. Sometimes I end up having to use a src
layout, which is a tad annoying but I tolerate it.
ATM I use your boilerplate and I just install your dev-dependencies via pip install -r requirements_dev.txt
😅. Seems like a better solution would be to specify them via extra_requires=
and then use pip install -e .[dev]
(StackOverflow).
IDK how to do this in pyproject.toml
(rather than setup.py
, but some googling leads me to believe one it'll be something like:
[project.optional-dependencies]
dev = [
"black",
"flake8",
# etc.
]
I'm in the middle of some other stuff rn so can't try it out, lmk if it works! Or I can try it later.
Ok, I moved requirements to pyproject.toml
and added a section about changing the Python version. Thanks for the ideas!
Useful and awesome repo, thanks! I just used it to start a new codebase and I have two quick suggestions.
mypy.ini
and line 3 inpyproject.toml
.requirements.txt
is for listing package versions for a particular deployment, not for distributing a package. For package distribution (i.e., installing the package on an unspecified machine), we should probably usesetuptools
. This is usually done via asetup.py
file, but since we are already using apyproject.toml
we can simply update it. Here's how we could do this in the context of this repo: