Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

77 pypi prep #130

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

77 pypi prep #130

wants to merge 2 commits into from

Conversation

andressl91
Copy link

@andressl91 andressl91 commented Nov 19, 2020

Related to #77, I want to suggest some minor improvements to the structure of the repository.

Currently all sourcecode is located in the src/ directory, meaning from the current setup.py, a python package structure of sortphotos will look something like this in site-packages.

(sortphotos) [flex@jackal]: ~/sandbox/foo/sortphotos>$ ls lib/python3.8/site-packages/
_distutils_hack/          pip-20.2.4.virtualenv         setuptools-50.3.2.virtualenv  _virtualenv.py
distutils-precedence.pth  pkg_resources/                sortphotos/                   wheel/
easy_install.py           __pycache__/                  sortphotos-1.0.dist-info/     wheel-0.35.1.dist-info/
pip/                      setuptools/                   src/                          wheel-0.35.1.virtualenv
pip-20.2.4.dist-info/     setuptools-50.3.2.dist-info/  _virtualenv.pth
(sortphotos) [flex@jackal]: ~/sandbox/foo/sortphotos>$ tree src/ -d
src/
├── Image-ExifTool
│   └── lib
│       ├── File
│       └── Image
│           └── ExifTool
│               ├── Charset
│               └── Lang
└── __pycache__

Renaming src to sortphotos we get

(sortphotos) [flex@jackal]: ~/sandbox/foo/sortphotos>$ ls lib/python3.8/site-packages/
_distutils_hack/          pip-20.2.4.virtualenv         setuptools-50.3.2.virtualenv  _virtualenv.py
distutils-precedence.pth  pkg_resources/                sortphotos/                   wheel/
easy_install.py           __pycache__/                  sortphotos-1.0.dist-info/     wheel-0.35.1.dist-info/
pip/                      setuptools/                   src/                          wheel-0.35.1.virtualenv
pip-20.2.4.dist-info/     setuptools-50.3.2.dist-info/  _virtualenv.pth
(sortphotos) [flex@jackal]: ~/sandbox/foo/sortphotos>$ tree sortphotos -d
sortphotos
├── Image-ExifTool
│   └── lib
│       ├── File
│       └── Image
│           └── ExifTool
│               ├── Charset
│               └── Lang
└── __pycache__

To run the sortphotos.py more neatly, I have also proposed to add a main.py in module entry folder (sortphotos).
In the current setup, one has to download the repo and run the module from within.

After creating a wheel or tar package and do pip install, an end user can simply do: python -m sortphotos -h

@andressl91 andressl91 marked this pull request as ready for review November 19, 2020 13:47
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