Replies: 1 comment 1 reply
-
Hi @kinow, thanks for reaching out. Would you like to propose a change in the docs to target this concern? We are always welcoming PRs :)
This seems to be a bit off... The For example: cd /tmp
rm -rf /tmp/myproj
mkdir /tmp/myproj
touch /tmp/myproj/app.py
cat <<EOS > /tmp/myproj/pyproject.toml
[build-system]
requires = ['setuptools>=62.1.0']
build-backend = 'setuptools.build_meta'
[project]
name = "myproj"
version = "42"
EOS
pip-run build -- -m build /tmp/myproj
unzip -l /tmp/myproj/dist/*.whl Should give us: Successfully built myproj-42.tar.gz and myproj-42-py3-none-any.whl
Archive: /tmp/myproj/dist/myproj-42-py3-none-any.whl
Length Date Time Name
--------- ---------- ----- ----
0 2022-04-27 10:42 app.py
109 2022-04-27 10:43 myproj-42.dist-info/METADATA
92 2022-04-27 10:43 myproj-42.dist-info/WHEEL
4 2022-04-27 10:43 myproj-42.dist-info/top_level.txt
340 2022-04-27 10:43 myproj-42.dist-info/RECORD
--------- -------
545 5 files |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I started using
pyproject.toml
andsetup.cfg
today after a colleague told me about it.I had an AWS Lambda script that I also run locally, in a repository with
requirements.txt
files and theapp.py
single script. Instead of migrating tosetup.py
, I went straight topyproject.toml
and tried to use the Package Discovery and Namespace Package docs, specifically the section “single-module distribution”.Its description matches, I think, exactly my case,
I tried first without anything, letting the build tools to try to find my
app.py
(right next topyproject.toml
andsetup.cfg), but that didn't work (it failed to include the
app.py` in the produced sdist file).After some googling, I found that this fixed the issue for me:
Is it something that would be worth an example for that in the “Package Discovery and Namespace Package” page? I found examples for src-layout, for the flat-layout, but the variation of a single module project appears to need
py_modules
, which may not be intuitive I guess.Thanks!
Bruno
Beta Was this translation helpful? Give feedback.
All reactions