Closed 0LL13 closed 3 years ago
Same error if I put
[options]
package_dir=
=src
packages=find:
[options.packages.find]
where=src
into setup.cfg
You have an attr:
directive in version
even though it's a just a version string. It should be:
version = 0.2.7
@layday Thanks, I removed the attr: part -- error remains though.
The error in your report is related to that. What error are you getting now?
It doesn't appear to be your intention to have an "src" folder inside the "persontitles" package. You should place "degrees", "titles", etc. under "persontitles", and place "persontitles" itself in an "src" folder. You will also need to create an __init__.py
in "persontitles" so that it's picked up as a package.
I changed a few things to reflect the new tree in setup.cfg - so here's the error:
error start___-
Collecting setuptools>=42
Using cached setuptools-57.1.0-py3-none-any.whl (818 kB)
Collecting wheel
Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Installing collected packages: setuptools, wheel
Successfully installed setuptools-57.1.0 wheel-0.36.2
Traceback (most recent call last):
File "/home/sam/.local/share/virtualenvs/persontitles-3KTRLSQ8/lib/python3.8/site-packages/pep517/_in_process.py", line 280, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home/sam/.local/share/virtualenvs/persontitles-3KTRLSQ8/lib/python3.8/site-packages/build/init.py", line 226, in build raise BuildBackendException('Backend operation failed: {!r}'.format(e)) build.BuildBackendException: Backend operation failed: CalledProcessError(1, ['/tmp/build-env-5owdhvww/bin/python', '/home/sam/.local/share/virtualenvs/persontitles-3KTRLSQ8/lib/python3.8/site-packages/pep517/_in_process.py', 'build_sdist', '/tmp/tmpdx59i6bk'])
ERROR Backend operation failed: CalledProcessError(1, ['/tmp/build-env-5owdhvww/bin/python', '/home/sam/.local/share/virtualenvs/persontitles-3KTRLSQ8/lib/python3.8/site-packages/pep517/_in_process.py', 'build_sdist', '/tmp/tmpdx59i6bk']) _____end error
changed setup.cfg:
packages_dir= =persontitles packages = degrees jobs titles salutations scripts = src/persontitles/degrees/academic_degrees.py src/persontitles/degrees/academic_uk.py src/persontitles/degrees/academic_us.py src/persontitles/jobs/gov_jobs.py src/persontitles/jobs/job_titles.py src/persontitles/titles/peertitles.py src/persontitles/titles/rel_titles.py src/persontitles/salutations/salutations.py
new tree:
persontitles/ ├── data │ ├── academic_uk.txt │ ├── academic_us1.txt │ ├── academic_us2.txt │ ├── academic_us.txt │ ├── degrees.json │ ├── english_jobtitles.txt │ ├── init.py │ ├── peertitles.json │ └── salutations.txt └── src ├── persontitles │ ├── degrees │ │ ├── academic_degrees.py │ │ ├── academic_uk.py │ │ ├── academic_us.py │ │ └── init.py │ ├── init.py │ ├── jobs │ │ ├── gov_jobs.py │ │ ├── init.py │ │ └── job_titles.py │ ├── salutations │ │ ├── init.py │ │ └── salutations.py │ └── titles │ ├── init.py │ ├── peertitles.py │ └── rel_titles.py
... with persontitles being a subdir of src
Two things look strange to me:
src
layout, but not configuring it in packages_dir
@merwok To be frank, I have no idea how to do that. I used setup.py before and it worked for the first 10 or so versions. How do I configure the layout? Like this? packages_dir= =src/persontitles
I removed the "scripts" section from setup.cfg and changed the packages_dir to src/persontitles but still no success.
@merwok So I thought about your remarks and changed the layout and after some rewriting of imports and stuff it finally worked! Thank you for giving me the right thing to look at!
Thank you for providing feedback on Python packaging!
To help us help you, please fill out as much of the following as you can. If a question is not relevant, feel free to skip it.
What is your operating system and version? Ubuntu 20.04.2 LTS
What is your Python version? Python 3.8.10 (default, Jun 2 2021, 10:49:15)
What version of pip do you have? pip 20.1
If following an online tutorial or guide, please provide a link to the page or section giving you trouble:
This is what I get using setup.cfg:
Using setup.py will get me this:
I have this tree structure with persontitles being the project directory:
This is the content of setup.cfg:
I put a init.py file into my src directory