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

Add __init__.py to become a regular package #1

Merged
merged 3 commits into from
Nov 16, 2023

Conversation

sgt0
Copy link
Contributor

@sgt0 sgt0 commented Nov 16, 2023

A __init__.py is required to be considered a "regular package" (https://docs.python.org/3.11/glossary.html#term-regular-package). Without this the setuptools.find_packages() in setup.py returns an empty list.

Before:

$ python -m pip install git+https://github.com/Jaded-Encoding-Thaumaturgy/getfscaler@920b4451d7968eb2ea42729600e22d7a14a3858c
$ python -m getfscaler
.venv\Scripts\python.exe: No module named getfscaler

After:

$ python -m pip install git+https://github.com/sgt0/getfscaler@package
$ python -m getfscaler
usage: getfscaler [-h] [--native-height NATIVE_HEIGHT] [--native_width NATIVE_WIDTH] [--crop CROP]
                  [--frame FRAME] [--field-based FIELDS] [--swap] [--extensive] [--out] [--debug]
                  input_file
getfscaler: error: the following arguments are required: input_file

Also set program name for argparse so it doesn't appear as __main__.py.

Updated a couple of the GitHub actions too while I'm here.

A `__init__.py` is required to be considered a "regular package"
(<https://docs.python.org/3.11/glossary.html#term-regular-package>).
Without this the `setuptools.find_packages()` in `setup.py` returns an
empty list.

Before:

    $ python -m pip install git+https://github.com/Jaded-Encoding-Thaumaturgy/getfscaler@920b4451d7968eb2ea42729600e22d7a14a3858c
    $ python -m getfscaler
    .venv\Scripts\python.exe: No module named getfscaler

After:

    $ python -m getfscaler
    usage: getfscaler [-h] [--native-height NATIVE_HEIGHT] [--native_width NATIVE_WIDTH] [--crop CROP]
                      [--frame FRAME] [--field-based FIELDS] [--swap] [--extensive] [--out] [--debug]
                      input_file
    getfscaler: error: the following arguments are required: input_file
This way the program name won't appear as "__main__.py".
@@ -24,6 +24,7 @@ jobs:
pip install vapoursynth-portable==${{ matrix.versions }}
pip install -r requirements.txt
pip install -r requirements-dev.txt
id: dependencies
Copy link
Contributor Author

@sgt0 sgt0 Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mypy step below wants to reference this step but this was missing an ID, so the mypy step was never running. I don't really think the if is needed because if this dependencies step fails we won't make it to the mypy step anyways.

@LightArrowsEXE LightArrowsEXE merged commit 7cd966d into Jaded-Encoding-Thaumaturgy:main Nov 16, 2023
1 check failed
@LightArrowsEXE
Copy link
Member

Thanks!

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