pypa / flit

Simplified packaging of Python modules
https://flit.pypa.io/
BSD 3-Clause "New" or "Revised" License
2.15k stars 131 forks source link

flit build traceback on src structure - unfriendly error message #384

Open dougransom opened 3 years ago

dougransom commented 3 years ago
PS C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro> python  --version
Python 3.8.6

Running on windows 32 bit.
PS C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro> python
Python 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:37:30) [MSC v.1927 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

PS C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro> flit build
Traceback (most recent call last):
  File "c:\python38-32\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python38-32\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python38-32\scripts\flit.exe\__main__.py", line 7, in <module>
  File "c:\python38-32\lib\site-packages\flit\__init__.py", line 154, in main
    main(args.ini_file, formats=set(args.format or []),
  File "c:\python38-32\lib\site-packages\flit\build.py", line 45, in main
    sb = SdistBuilder.from_ini_path(ini_file)
  File "c:\python38-32\lib\site-packages\flit_core\sdist.py", line 102, in from_ini_path
    module = common.Module(ini_info.module, srcdir)
  File "c:\python38-32\lib\site-packages\flit_core\common.py", line 55, in __init__
    raise ValueError("No file/folder found for module {}".format(name))
ValueError: No file/folder found for module unimacro
PS C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro>
`PS C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro> cat .\pyproject.toml
[build-system]
requires = ["flit_core >=2,<4"]
build-backend = "flit_core.buildapi"

PS C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro> pip show flit
Name: flit
Version: 3.0.0
Summary: A simple packaging tool for simple packages.
Home-page: https://github.com/takluyver/flit
Author: Thomas Kluyver
Author-email: thomas@kluyver.me.uk
License: UNKNOWN
Location: c:\python38-32\lib\site-packages
Requires: flit-core, requests, docutils, pytoml
Required-by:
PS C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro>
[tool.flit.metadata]
module="unimacro"
author = "quintijn"
author-email = "quintijn@me.uk"
home-page = "https://github.com/dictation-toolbox/unimacro"
description-file = "README.md"

requires=["wxPython >=4.1.1",
                  "debugypy > 1.2.0",
                  "pywin32 >= 300"]

classifiers=[   "Development Status :: 4 - Beta",
                                "Topic :: Multimedia :: Sound/Audio :: Speech",
                                "Topic :: Scientific/Engineering :: Human Machine Interfaces",
                                ]

requires-python = ">=3.8"
keywords="dragon,speech,dictation,dictation-toolobx,unimacro,natlink"

[tool.flit.scripts]

folder structure:

PS C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro> ls

    Directory: C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
da---l        2020-12-17  11:12 AM                dist
da---l        2020-12-17  10:08 AM                src
da---l        2020-12-17   9:32 AM                __pycache__
-a---l        2020-12-03   8:59 AM            207 .gitignore
-a---l        2020-12-17   6:33 AM            196 build_package.ps1
-a---l        2020-11-29  10:27 AM           4576 ding.wav
-a---l        2020-12-17  11:02 AM             64 flit_woes.html
-a---l        2020-12-02   3:32 PM          27313 grammar.bin
-a---l        2020-11-29  10:27 AM         571436 hallo.wav
-a---l        2020-11-29  10:27 AM           3771 LICENSE.txt
-a---l        2020-12-16   6:50 AM             84 Packaging Python Projects — Python Packaging User Guide.url
-a---l        2020-12-17  11:19 AM            676 pyproject.toml
-a---l        2020-12-16   6:07 AM            677 README.md
-a---l        2020-12-16   8:46 AM             78 Why use Flit- — Flit 3.0.0 documentation.url

PS C:\Users\dougr\OneDrive\doug\dication_toolbox\unimacro>

I did note if i renamed "src" to "unimacro" it worked but that is not how our project os organized.

dougransom commented 3 years ago

ok this turned out to be becuase i didnt' realize the code didn't go in src, it goes in src/modulename. The error could be more descriptive for a newbie?