Skip to content

Tidy install a bit - #26

Open
kousu wants to merge 2 commits into
neuropoly:masterfrom
kousu:patch-2
Open

kousu wants to merge 2 commits into
neuropoly:masterfrom
kousu:patch-2

Conversation

@kousu

@kousu kousu commented Apr 7, 2021

Copy link
Copy Markdown

https://www.python.org/dev/peps/pep-0420/ says we should prefer not to have init.py. The only information in it is copy-pasted to setup.py (which is the proper place for it, IMO).

And https://pypi.org/project/changelog-neuropoly/ is currently blank:

2021-04-07-123143_765x202_scrot

so this just fixes that up too.

@kousu
kousu marked this pull request as ready for review April 7, 2021 16:00
@Drulex

Drulex commented May 11, 2021

Copy link
Copy Markdown
Contributor

https://www.python.org/dev/peps/pep-0420/ says we should prefer not to have init.py. The only information in it is copy-pasted to setup.py (which is the proper place for it, IMO).

I wasn't aware of this PEP. __init__.py is there to make python treat the changelog directory as a package. If you remove it the current installation using setuptools will not work (see line below in setup.py):

'changelog=changelog.changelog:main',

Perhaps you need to also change setup.py?

Also the __version__ string is there so you can query the package's version as so:

[drulex@gentoo-p53 changelog] [master] $  python
Python 3.7.10 (default, Apr 13 2021, 09:35:06)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import changelog
>>> changelog.__version__
'1.1.0'

TBH I haven't read the full PEP, this is just how I usually structure my python projects. It allows easy testing with python -m when I don't write setup.py files and makes is easy to extend and add other submodules to the package. Please educate me if there is a better way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants