stephen_lloyd
03/21/2021, 2:14 PM~/projects/my-tap via 🐍 3.7.5
➜ poetry run my-tap --config ~/singer.io/my-tap/config.json
ModuleOrPackageNotFound
No file/folder found for package my-tap
at ~/.poetry/lib/poetry/_vendor/py3.7/poetry/core/masonry/utils/module.py:59 in __init__
55│ }
56│ ]
57│ else:
58│ raise ModuleOrPackageNotFound(
→ 59│ "No file/folder found for package {}".format(name)
60│ )
61│
62│ for package in packages:
63│ formats = package.get("format")
visch
03/21/2021, 2:29 PMtree
in your my-tap directory. It sounds like you don't have a file/folder called my-tap in that directory anywhere. I'm new to Poetry but it sounds like it's expecting that somewherestephen_lloyd
03/21/2021, 3:26 PM~/projects/my-tap/my-tap/tap.py
and python did not like the hyphen in a folder that would act as a module (or something like that). I changed to ~/projects/my-tap/my_tap/tap.py
@aaronsteers I wonder if the cookiecutter can/should replace the hyphen with an underscore for the subfolder when the project is being created? I think Poetry’s default if you give my-tap
would be to create a project folder as my-tap
with a subfolder of my_tap
. The cookiecutter didn’t do that.
~/projects via 🐍 3.7.5
➜ poetry new my-tap
Created package my_tap in my-tap
~/projects via 🐍 3.7.5
➜ ls my-tap
README.rst my_tap pyproject.toml tests
stephen_lloyd
03/21/2021, 3:27 PMvisch
03/21/2021, 3:33 PMvisch
03/21/2021, 3:34 PMaaronsteers
03/21/2021, 5:05 PMstephen_lloyd
03/22/2021, 4:01 AM~/projects via 🐍 3.7.5
➜ cookiecutter <https://gitlab.com/meltano/singer-sdk> --directory="cookiecutter/tap-template"
You've downloaded /Users/stephenlloyd/.cookiecutters/singer-sdk before. Is it okay to delete and re-download it? [yes]: yes
source_name [MySourceName]: testtap
tap_id [tap-testtap]:
library_name [tap_testtap]: tap-testtap
Select stream_type:
1 - Database
2 - REST
3 - GraphQL
4 - Other
Choose from 1, 2, 3, 4 [1]: 2
Select auth_method:
1 - Simple
2 - OAuth2
3 - JWT
4 - Custom or N/A
Choose from 1, 2, 3, 4 [1]: 1
~/projects via 🐍 3.7.5
➜ cd tap-testtap
~/projects/tap-testtap via 🐍 3.7.5
➜ ls
README.md pyproject.toml tap-testtap
Poetry saves me from that mistake, but the cookiecutter does not. I wonder if the cookiecutter could recommend a name and replace any problematic characters if the user does not take the suggestion. I.e., folks like me thinking it would be better to be consistent with a dash all the way through.aaronsteers
03/22/2021, 4:31 AMMySourceName
) - used in class definitions so it cannot have spaces or special characters.
(2) “tap id” (e.g. tap-my-tap
), which is also the CLI executable and is expected to start with tap-
and be punctuated by dashes.
(3) “library name” (e.g. tap_my_tap
) which is used as folder name and library name, and (as you’ve found) python won’t allow any special characters here besides underscores. While we do default this to the same as “tap id” except all dashes replaced with underscores, I can see also the perspective of wanting them both to be the same if all else were equal. This is helpful feedback.
I’ll log an issue regarding the following, as I think you’ve surfaced some important room for improvement in the process: (1) at minimum clarify in the readme docs about each field’s constraints, (2) add to troubleshooting section the specific symptoms of what you’ve logged here related to dashes, (3) see if we can add better hints or perhaps a hard failure in the cookiecutter process itself.
Thanks very much for logging this - I appreciate the feedback on your experience.stephen_lloyd
03/22/2021, 4:33 AMvisch
03/22/2021, 12:40 PMaaronsteers
03/22/2021, 6:06 PM