Skip to content

Add setup.py to allow pip install#458

Open
phistrom wants to merge 1 commit into
GAM-team:mainfrom
phistrom:add-setup-py
Open

Add setup.py to allow pip install#458
phistrom wants to merge 1 commit into
GAM-team:mainfrom
phistrom:add-setup-py

Conversation

@phistrom

@phistrom phistrom commented Mar 22, 2024

Copy link
Copy Markdown

Clone this repository and use python setup.py install . After install, gyb can be used on the command line anywhere (client_secrets.json and oauth2service.json need to be in the current directory or use --config-folder).

For installation, you could also use pip install git+https://github.com/GAM-team/got-your-back.git if this PR is accepted. (pip install got-your-back might be possible if Mr. Lee wishes to use twine to upload the package to PyPI).

While I would have liked to import from gyb.py on line 4 of setup.py, the packages in that module may not have been installed yet, leading to an import error. In an effort to modify as little of the original code as possible, I copied the values of the __author__, __email__, __program_name__, and __version__ to get around this.

Line 56 of setup.py adds gyb to the PATH. Tested on Windows (Python 3.12), MacOS (Python 3.11), and the python:3.12-slim Docker container (Debian Linux).

The original gyb.py script was modified as minimally as possible to allow setup.py to make an entry point script. The behavior should be precisely the same whether or not it was installed with pip.

Relevant issues:
#239
#379

After install, "gyb" can be used on the command line anywhere.
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.

1 participant