I recently made an open-source pip module and I and to publish it is PyPI. I know on the PyPI, I can directly publish the modules dist/*
folder using twine
but I also want to publish this module on GitHub, Gitlab & My own organization's official git repo. So, I was wondering which files should I add to the git
repository?
src
Folder: This is the main folder of my file that I codded my python modules.
So on the git repository should I upload:
venv
folder)dist
Folder, src
Folder, .gitinore
, LICENSE
, README.md
, setup.py
src
Folderdist
FolderYou only need to include the src
folder, .gitinore
, LICENSE
, README.md
, and setup.py
. Ideally you always want to re-build before publishing to Pypi, so you do not need the dist
folder.
However, I recommend using the dependency management tool poetry, which uses a pyproject.toml
instead of the setup.py
. It's much more human-readable and easier to manage than the old-fashioned setup.py
.
poetry also allows publishing your package to Pypi with a single command poetry publish --build ...
.