0

I am trying to publish my first pip package, but this isn't very easy. I have the following file structure for my project:

src
  main.py
  about.py
  __init__.py
LICENSE
pyproject.toml
README.md
setup.cfg

How would I go about starting the main.py-file using a console script, defined in setup.cfg? The main.py-file doesn't have a main function. about.py is an extra part of my code to show a simple about screen.

JasperDG
  • 137
  • 1
  • 3
  • 7

1 Answers1

0

You should create a python package with a different name (src is not recommended) and name your main file as __main__.py. This way, when you execute your package with python package_name the __main__.py file will be executed

For example:

src
    package_name
        __main__.py
        about.py
        __init__.py
LICENSE
pyproject.toml
README.md
setup.cfg
Fran Arenas
  • 639
  • 6
  • 18