Nathaniel D. Porter · @ndporter
548 followers · 400 posts · Server sciences.social
gram · @orsinium
67 followers · 231 posts · Server fosstodon.org

@mgorny You can use to produce sdist distributions with autogenerated setup.py:

flit.pypa.io/en/stable/cmdline

#flit #python

Last updated 1 year ago

Lang · @4lang
5 followers · 63 posts · Server twiukraine.com
JoshB :python: · @joshburnett
38 followers · 108 posts · Server fosstodon.org

@m_cadek I found to be relatively easy when I started using it recently. The only thing that stumped me initially was that I had a single-file module, but I wanted some data files to get packaged with it. Flit handles that automatically, but you need to structure your code as a package (directory w/ an __init__.py file) instead of just a module. Once I got that straightened out, it was smooth sailing.

flit.pypa.io/en/stable/index.h

#flit

Last updated 2 years ago

JoshB :python: · @joshburnett
32 followers · 64 posts · Server fosstodon.org

Solved! After banging my head on this some more I found it's related to the distinction between a module (a single .py file) and a package (a directory with a __init__.py file in it, along with other stuff).

The docs say 'Data files within a package directory are automatically included.' This is 100% technically correct, but easy for a beginner (like me, in this case!) to misunderstand and think that anything in their project directory will be included.

#flit #TIL #python #packaging

Last updated 2 years ago