🌐
GitHub
docs.github.com › en › packages › learn-github-packages › introduction-to-github-packages
Introduction to GitHub Packages - GitHub Docs
GitHub Packages offers different package registries for commonly used package managers, such as npm, RubyGems, Apache Maven, Gradle, Docker, and NuGet. GitHub's Container registry is optimized for containers and supports Docker and OCI images.
Discussions

Packaging, deploying and reusing private libraries?
You can host and install python packages from a git repo, here's a description of how https://gist.github.com/javrasya/e95ade856ff42e4649972f8a54368459 As far as how to "make" a package, there's several ways to do it. I personally have been using "uv" lately for pip and packaging and stuff https://sarahglasmacher.com/how-to-build-python-package-uv/ Poetry is another option that is fairly easy to build and publish packages with: https://www.geeksforgeeks.org/how-to-build-and-publish-python-packages-with-poetry/ If you use a private pip repo, then there are settings you can add to pyproject.toml to specify where you want to deploy to You can also install a python package just from the directory the source code is in, so you don't really even need to install it from GH unless you want to, just use pip install /path/to/python/project More on reddit.com
🌐 r/learnpython
4
1
February 20, 2025
GitHub package registry support
I have searched the issues of this repo and believe that this is not a duplicate. I have searched the documentation and believe that my question is not covered. Feature Request I think adding suppo... More on github.com
🌐 github.com
3
November 22, 2019
pip - How to install Python package from GitHub? - Stack Overflow
To install Python package from github, you need to clone that repository. More on stackoverflow.com
🌐 stackoverflow.com
pip install package from Artifact Registry from github action - Stack Overflow
Try installing these two packages ... your python packages. Make sure that your service account has required permissions · Make sure you give read and write permissions in your workflow file. ... name: Example Workflow on: push: branches: - main pull_request: branches: - main permissions: id-token: write contents: read jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 with: fetch-depth: 2 - name: Authenticate to Google Cloud id: gcloud_auth uses: google-github-actions/auth@v2 ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › orgs › community › discussions › 154459
Publish Your Package to GitHub Package Registry · community · Discussion #154459
Go to GitHub Token Settings. Create a new personal access token with write:packages and read:packages permissions.
🌐
GitHub
github.com › pypi
The Python Package Index · GitHub
The Python Package Index has 15 repositories available. Follow their code on GitHub.
🌐
Medium
medium.com › @thomas.vidori › how-to-create-a-python-package-and-publish-it-on-github-eebc78b2a12d
Creating Python packages and publishing on GitHub | Medium
February 24, 2025 - Creating a Python package, publishing it on GitHub, and installing it from local and remote repositories, step-by-step tutorial with…
🌐
Reddit
reddit.com › r/learnpython › packaging, deploying and reusing private libraries?
r/learnpython on Reddit: Packaging, deploying and reusing private libraries?
February 20, 2025 -

So, let's suppose I develop ProjectA in Python. I store its source code in my local Git repository. Then I develop ProjectB, and again, I store it in Git, in a separate folder.

Then I realise that both ProjectA and ProjectB share some common functions/classes, and it would make sense to extract them into a separate library pachura3_tools and develop it independently, with its own versioning etc. And then I would remove all traces of shared code from both ProjectA and ProjectB, add pachura3_tools to their dependencies, and pip install pachura3_tools to their virtual environments.

My first problem is that I have no idea how to package pachura3_tools so it would become a library that can be managed with pip (publishing, installing, upgrading). Second problem: I understand I need an artifact repository that would host all the different versions of pachura3_tools... much like e.g. Maven .m2 repository for Java... how do I set it up? If possible, I would like to host it locally and not in public/on the internet.

🌐
GitHub
docs.github.com › en › packages › learn-github-packages › publishing-a-package
Publishing a package - GitHub Docs
For instructions specific to your package client, see Working with a GitHub Packages registry.
🌐
GitHub
docs.github.com › actions › guides › building-and-testing-python
Building and testing Python - GitHub Docs
The default version of Python varies between GitHub-hosted runners, which may cause unexpected changes or use an older version than expected. GitHub-hosted runners have the pip package manager installed. You can use pip to install dependencies from the PyPI package registry before building and testing your code.
Find elsewhere
🌐
GitHub
github.com › orgs › community › discussions › 8542
GitHub Packages | Support for python packages · community · Discussion #8542
This has been a request for a few years now: https://github.community/t/pypi-compatible-github-package-registry/14615 Still no commitment to this though: GitHub Public Roadmap (view)
🌐
GitLab
docs.gitlab.com › user › packages › pypi_repository
PyPI packages in the package registry | GitLab Docs
A deploy token with the scope set to read_package_registry, write_package_registry, or both. A CI/CD job token. Do not use authentication methods other than the methods documented here. Undocumented authentication methods might be removed in the future. ... Update the TWINE_USERNAME and TWINE_PASSWORD environment variables. ... run: image: python:latest variables: TWINE_USERNAME: <personal_access_token_name> TWINE_PASSWORD: <personal_access_token> script: - pip install build twine - python -m build - python -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
🌐
GitHub
github.com › python-poetry › poetry › issues › 1624
GitHub package registry support · Issue #1624 · python-poetry/poetry
November 22, 2019 - I haven't checked the docs yet, but I am guessing there is already custom index support. I just feel that since the GitHub package repository is a bit different, it would make sense to add direct support for it.
Author   RDIL
🌐
GitHub
github.com › PyGithub › PyGithub
GitHub - PyGithub/PyGithub: Typed interactions with the GitHub API v3 · GitHub
This library enables you to manage GitHub resources such as repositories, user profiles, and organizations in your Python applications.
Starred by 7.7K users
Forked by 1.9K users
Languages   Python 99.6% | Shell 0.4%
🌐
Read the Docs
docs.readthedocs.com › platform › stable › guides › private-python-packages.html
How to install private python packages — Read the Docs user documentation
You need to create a fine-grained personal access token with the Contents repository permission set to Read-only. Follow the GitHub documentation on how to create a fine-grained personal access token. ... You need to create a deploy token with the read_repository scope for the repository you want to install the package from.
🌐
GitHub
docs.github.com › en › packages › learn-github-packages › viewing-packages
Viewing packages - GitHub Docs
Repository-scoped packages inherit their permissions and visibility from the repository in which the package is published. Some registries only support repository-scoped packages.
Top answer
1 of 2
1

I was facing the same issue, I found out that according to this GCP Documentation, I didn't have keyring and keyrings.google-artifactregistry-auth installed,

  1. Try installing these two packages in the step where you install your python packages.
  2. Make sure that your service account has required permissions
  3. Make sure you give read and write permissions in your workflow file.

Example Workflow,

name: Example Workflow
on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

permissions:
  id-token: write
  contents: read

jobs:
   runs-on: ubuntu-latest
   steps:
     - uses: actions/checkout@v3
       with:
         fetch-depth: 2

     - name: Authenticate to Google Cloud
       id: gcloud_auth
       uses: google-github-actions/auth@v2
       with:
         token_format: 'access_token'
         workload_identity_provider: 'projects/<PROJECT_ID>/locations/global/workloadIdentityPools/github-pool/providers/example-github-provider'
         service_account: '[email protected]'

     - name: Install dependencies
       id: install_dependencies
       run: |
            python -m pip install keyrings.google-artifactregistry-auth
            pip install --extra-index-url https://europe-west9-python.pkg.dev/path-to/simple/ PACKAGE

I hope this helps!

2 of 2
0

As suggested in this Github Link Can you try particularly giving the packages_to_install tag like below:

pip install --index-url https://europe-west9-python.pkg.dev/path-to/simple/ PACKAGE as pip install --index-url https://europe-west9-python.pkg.dev/path-to/simple/ packages_to_install=PACKAGE

Also based on your logs

Traceback (most recent call last): File [...] username, [...]_prompt_for_password [...] ask_input return input(message) EOFError: EOF when reading a line.

Can you try to install a pip package from Artifact Registry and to work with the workflow, Try with the below steps:

  1. Create an Artifacts Registry Python repository
  2. Create a Composer environment (everything is default)
  3. Create a service account
  4. Grant permissions in Artifacts Registry for this account
  5. Download JSON key for a service account and encode it in base64 using command cat service-account.json | base64
  6. Upload pip.conf to /config/pip/pip.conf in Composer GCS bucket

Note: Contents of this file as it is mentioned in Documentation, where KEY is a string generated on a step #5.

Please also have a look at this Stackoverflow Link.

🌐
GitHub
docs.github.com › en › packages › working-with-a-github-packages-registry › working-with-the-npm-registry
Working with the npm registry - GitHub Packages
A personal access token (classic) with at least read:packages scope to install packages associated with other private repositories (GITHUB_TOKEN can be used if the repository is granted read access to the package. See Configuring a package's access control and visibility). This registry supports granular permissions.
🌐
YouTube
youtube.com › watch
How to Create Build and Publish Custom Python Package Using GitHub Action on PyPI.org - YouTube
===================================================================1. SUBSCRIBE FOR MORE LEARNING : https://www.youtube.com/channel/UCv9MUffHWyo2GgLIDLVu0KQ=...
Published   April 20, 2023
🌐
GitHub
github.com › features › actions
GitHub Actions · GitHub
Whether you want to build a container, deploy a web service, or automate welcoming new users to your open source projects—there's an action for that. Pair GitHub Packages with Actions to simplify package management, including version updates, fast distribution with our global CDN, and dependency resolution, using your existing GITHUB_TOKEN.
🌐
GitLab
docs.gitlab.com › user › packages › package_registry
Package registry | GitLab Docs
The Deploy > Package registry entry is removed from the sidebar. Project permissions determine which members and users can download, push, or delete packages.