dgursoy / cold

Coded Laue Diffraction Imaging
BSD 3-Clause "New" or "Revised" License
0 stars 4 forks source link

REF: Move main function into __main__ module #3

Closed carterbox closed 2 years ago

carterbox commented 2 years ago

Following convention, python packages with a CLI implement the CLI in a file called main.py which is located in the top level namespace of the package [1]. Optionally, you can then have setuptools or whatever packager create a console script entry point [2] which automatically creates a bash/batch script and puts it on the path during installation. You can see an example of this in jeweler [3].

[1] https://docs.python.org/3/library/__main__.html#main-py-in-python-packages [2] https://setuptools.pypa.io/en/latest/userguide/entry_point.html [3a] https://github.com/carterbox/jeweler/blob/6d9482c71046745744ab9762390191cb7d364307/setup.py#L16 [3b] https://github.com/carterbox/jeweler/blob/master/src/jeweler/__main__.py

github-actions[bot] commented 2 years ago

Message that will be displayed on users first issue

github-actions[bot] commented 2 years ago

Stale issue message