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

Make GAM pip-installable #1417

Merged
merged 2 commits into from
Aug 27, 2021
Merged

Make GAM pip-installable #1417

merged 2 commits into from
Aug 27, 2021

Conversation

janosh
Copy link
Contributor

@janosh janosh commented Aug 26, 2021

This is just a rough draft to get the ball rolling on making GAM pip-installable and closing #720. I hope to get some feedback since GAM has a slightly unusual package structure and I'm unfamiliar with GAMs current installation procedure.

src/setup.cfg Outdated
@@ -0,0 +1,48 @@
[metadata]
name = Google Apps Manager
Copy link
Member

Choose a reason for hiding this comment

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

"GAM" no longer stands for anything (and Google has renamed the product twice since it did anyway). Make this:

GAM for Google Workspace

src/setup.cfg Outdated

[options]
packages = find:
python_requires = >=3.7
Copy link
Member

Choose a reason for hiding this comment

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

3.6 is still supported today though that's going away soon enough

@jay0lee
Copy link
Member

jay0lee commented Aug 27, 2021

added a few comments but generally looks good to me. If you can hit those changes then we can merge this and see what pip will do when pointed at the GitHub repository.

@jay0lee jay0lee merged commit 1100fdd into GAM-team:main Aug 27, 2021
@janosh
Copy link
Contributor Author

janosh commented Aug 27, 2021

@jay0lee The thing I was uncertain about is will pip even find the setup.py if its located in a subfolder? It might need to be at root level in which case we'd have to change the find: directive in order to include the right package dirs.

Also, how would the auth process work after pip-installation? Does it trigger automatically first time you try to invoke gam?

@jay0lee
Copy link
Member

jay0lee commented Aug 27, 2021

It seems to work with a command like:

pip install git+https://github.com/jay0lee/GAM.git#subdirectory=src

somethings wrong with the entry point though, I've made some changes to gam/main.py that should help. Also, the import restrictions from requirements.txt (only require distro if we're on Linux and only require importlib.metadata if we are Python < 3.8) needed to be added to setup.cfg for me. See my latest commit.

@janosh
Copy link
Contributor Author

janosh commented Aug 27, 2021

Running

pip install git+https://github.com/jay0lee/GAM.git#subdirectory=src

I get

  creating GAM_for_Google_Workspace.egg-info
  writing GAM_for_Google_Workspace.egg-info/PKG-INFO
  writing dependency_links to GAM_for_Google_Workspace.egg-info/dependency_links.txt
  writing entry points to GAM_for_Google_Workspace.egg-info/entry_points.txt
  writing requirements to GAM_for_Google_Workspace.egg-info/requires.txt
  writing top-level names to GAM_for_Google_Workspace.egg-info/top_level.txt
  writing manifest file 'GAM_for_Google_Workspace.egg-info/SOURCES.txt'
  reading manifest file 'GAM_for_Google_Workspace.egg-info/SOURCES.txt'
  writing manifest file 'GAM_for_Google_Workspace.egg-info/SOURCES.txt'
  Copying GAM_for_Google_Workspace.egg-info to build/bdist.macosx-11-x86_64/wheel/GAM_for_Google_Workspace-6.0.7-py3.9.egg-info
  running install_scripts
  error: [Errno 2] No such file or directory: 'src/license.rtf'
  ----------------------------------------
  ERROR: Failed building wheel for GAM-for-Google-Workspace

This is on macOS with Python 3.9.6. You didn't see this error?

Also, should we add the install command to the readme?

@jay0lee
Copy link
Member

jay0lee commented Aug 27, 2021 via email

@janosh
Copy link
Contributor Author

janosh commented Aug 28, 2021

No, but I suspect if you remove src/ from the license line in setup.cfg it will solve it.

Yes, I was going to submit a PR for that but awaiting your response on whether to mention pip install in readme.

Does pip really use .rtf format? The LICENSE file might be a battery choice there for plaintext.

Not sure. Support in what sense? It doesn't actually display it anyway, does it?

Are you planning to release GAM on PyPI?

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