From bd4208607be93b91f9a8a74f63c17dd1f4f1f5b5 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 21 Jul 2025 15:53:51 -0400 Subject: [PATCH 1/6] wiki: update pip install instructions --- wiki/Install-GAM-as-Python-Library.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/wiki/Install-GAM-as-Python-Library.md b/wiki/Install-GAM-as-Python-Library.md index 3ea221bd..5929f4ff 100644 --- a/wiki/Install-GAM-as-Python-Library.md +++ b/wiki/Install-GAM-as-Python-Library.md @@ -1,20 +1,14 @@ # Install GAM as Python Library -Thanks to Jay Lee for showing me how to do this. - -On Windows, you need to install Git to use the pip command. -* See: https://pythoninoffice.com/python-pip-install-from-github/ - -Scroll down to Install Git You can install GAM as a Python library with pip. ``` -pip install git+https://github.com/GAM-team/GAM.git#subdirectory=src +pip install gam7 ``` Or as a PEP 508 Requirement Specifier, e.g. in requirements.txt file: ``` -gam-for-google-workspace @ git+https://github.com/GAM-team/GAM.git#subdirectory=src +gam7 ``` Or a pyproject.toml file: @@ -23,13 +17,13 @@ Or a pyproject.toml file: name = "your-project" # ... dependencies = [ - "gam-for-google-workspace @ git+https://github.com/GAM-team/GAM.git#subdirectory=src" + "gam7" ] ``` -Target a specific revision or tag: +Target a specific version: ``` -gam-for-google-workspace @ git+https://github.com/GAM-team/GAM.git@v7.12.01#subdirectory=src +gam7==/7.13.3 ``` ## Using the library From 048d88c7a01b58d2b7a6d3df9a4e2ee2226c935b Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 21 Jul 2025 19:56:14 +0000 Subject: [PATCH 2/6] setup.cfg/py no longer necessary, pyproject.toml should do --- pyproject.toml | 2 +- src/setup.cfg | 55 -------------------------------------------------- src/setup.py | 3 --- 3 files changed, 1 insertion(+), 59 deletions(-) delete mode 100644 src/setup.cfg delete mode 100644 src/setup.py diff --git a/pyproject.toml b/pyproject.toml index df088216..3e97be09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ authors = [ { name="Jay Lee", email="jay0lee@gmail.com" }, { name="Ross Scroggs", email="Ross.Scroggs@gmail.com" }, ] -# The following deps and optional deps should be edited to match: setup.cfg, requirements.txt +# The following deps and optional deps should be edited to match requirements.txt # notice that yubikey-manager remains optional further down since it is less command and adds #significant compile dependencies. dependencies = [ diff --git a/src/setup.cfg b/src/setup.cfg deleted file mode 100644 index 714d80da..00000000 --- a/src/setup.cfg +++ /dev/null @@ -1,55 +0,0 @@ -[metadata] -name = GAM for Google Workspace -version = attr: gam__version__ -description = Command line management for Google Workspaces -long_description = file: readme.md -long_description_content_type = text/markdown -url = https://github.com/GAM-team/GAM -author = GAM Team -author_email = google-apps-manager@googlegroups.com -license = Apache -license_files = LICENSE -keywords = google, oauth2, gsuite, google-apps, google-admin-sdk, google-drive, google-cloud, google-calendar, gam, google-api, oauth2-client, google-workspace -classifiers = - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Programming Language :: Python :: 3.13 - License :: OSI Approved :: Apache License - -[options] -packages = find: -python_requires = >= 3.9 -# The following files should be edited to match: pyproject.toml, requirements.txt -install_requires = - chardet >= 5.2.0 - cryptography >= 44.0.2 - distro; sys_platform == 'linux' - filelock >= 3.18.0 - google-api-python-client >= 2.167.0 - google-auth-httplib2 >= 0.2.0 - google-auth-oauthlib >= 1.2.2 - google-auth >= 2.39.0 - httplib2 >= 0.22.0 - lxml >= 5.4.0 - passlib >= 1.7.4 - pathvalidate >= 3.2.3 - python-dateutil - yubikey-manager >= 5.6.1 - -[options.package_data] -* = *.pem - -# used during pip install .[test] -[options.extras_require] -test = pre-commit - -[options.entry_points] -console_scripts = - gam = gam.__main__:main - -[bdist_wheel] -universal = True diff --git a/src/setup.py b/src/setup.py deleted file mode 100644 index 60684932..00000000 --- a/src/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() From fcb50e1e932f65d7d5ddfaa63adb083f2c150b18 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 21 Jul 2025 16:01:08 -0400 Subject: [PATCH 3/6] point gha at pyporojects.toml, deprecate requirements.txt --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f831c325..fbcf1048 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -473,8 +473,7 @@ jobs: run: | echo "before anything..." "$PYTHON" -m pip list - "$PYTHON" -m pip install --upgrade -r requirements.txt - echo "after requirements..." + "$PYTHON" -m pip install --upgrade -r ../pyproject.toml "$PYTHON" -m pip list #"$PYTHON" -m pip install --force-reinstall --no-deps --upgrade cryptography echo "after everything..." From 597bbe2db94342ba77afd04f272d761bc1f60118 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 21 Jul 2025 16:09:34 -0400 Subject: [PATCH 4/6] actions: fix pip install from pyproject.toml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbcf1048..f99f90cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -473,7 +473,7 @@ jobs: run: | echo "before anything..." "$PYTHON" -m pip list - "$PYTHON" -m pip install --upgrade -r ../pyproject.toml + "$PYTHON" -m pip install --upgrade .. "$PYTHON" -m pip list #"$PYTHON" -m pip install --force-reinstall --no-deps --upgrade cryptography echo "after everything..." From 332d6c076119639565156a240e90d982dcc3f55d Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 21 Jul 2025 16:13:18 -0400 Subject: [PATCH 5/6] actions: install yubikey libs so they are in binary builds --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f99f90cc..90b5221a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -473,7 +473,7 @@ jobs: run: | echo "before anything..." "$PYTHON" -m pip list - "$PYTHON" -m pip install --upgrade .. + "$PYTHON" -m pip install --upgrade ..[yubikey] "$PYTHON" -m pip list #"$PYTHON" -m pip install --force-reinstall --no-deps --upgrade cryptography echo "after everything..." From 1bed2383ff8505a852f83a560765c87042c6a9cb Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 21 Jul 2025 20:49:24 +0000 Subject: [PATCH 6/6] remove deprecated and duplicate data requirements.txt You can install deps with: pip install /path/to/gam/folder/with/pyproject.toml/file/in/it --- pyproject.toml | 1 - src/requirements.txt | 14 -------------- 2 files changed, 15 deletions(-) delete mode 100644 src/requirements.txt diff --git a/pyproject.toml b/pyproject.toml index 3e97be09..61c5f06b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,6 @@ authors = [ { name="Jay Lee", email="jay0lee@gmail.com" }, { name="Ross Scroggs", email="Ross.Scroggs@gmail.com" }, ] -# The following deps and optional deps should be edited to match requirements.txt # notice that yubikey-manager remains optional further down since it is less command and adds #significant compile dependencies. dependencies = [ diff --git a/src/requirements.txt b/src/requirements.txt deleted file mode 100644 index 7162c77e..00000000 --- a/src/requirements.txt +++ /dev/null @@ -1,14 +0,0 @@ -chardet>=5.2.0 -cryptography>=44.0.2 -distro; sys_platform=='linux' -filelock>=3.18.0 -google-api-python-client>=2.167.0 -google-auth-httplib2>=0.2.0 -google-auth-oauthlib>=1.2.2 -google-auth>=2.39.0 -httplib2>=0.22.0 -lxml>=5.4.0 -passlib>=1.7.4 -pathvalidate>=3.2.3 -python-dateutil -yubikey-manager>=5.6.1