Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

Add support for private repositories

Open SagiTauberExodigo opened this issue 3 years ago • 5 comments

Context

If your virtual env uses a package from a private repository zappa will fail to package all of the project dependcies.

Expected Behavior

Zappa will try to query all the urls that pip is configured to use when trying to package the dependcies.

Actual Behavior

Zappa only tries to fetch files from Pypi. this causes a KeyError in get_manylinux_wheel_url, specifically in line 1030 if package_version not in data["releases"]: if the package is not in Pypi "releases" is not a key in data.

Possible Fix

Check pip to see what urls it's checking. A easier solution is to change line 1030 to if package_version not in data.get("releases", []): but it wont download the manylinux files if they exists

Steps to Reproduce

  1. Add a dependency from a private repo 2.Run zappa deploy or zappa update

Your Environment

  • Zappa version used: 0.54.1
  • Operating System and Python version: 3.8.10

SagiTauberExodigo avatar Jul 06 '22 09:07 SagiTauberExodigo

We could add support for parsing the pip.conf file to look for alternative repos. This wouldn't cover all cases though as you can install packages from other repositories without adding it to the pip.conf file, it also wouldn't cover other package managers like Poetry.

I'm unsure if there is enough need to go as far as parsing various configs looking for private repos at this stage or whether we just update the code to handle there being no releases as you mentioned

thommor avatar Jul 27 '22 07:07 thommor

I believe I've installed from a private github repository before, this is refering to a private package repository, right?

monkut avatar Nov 19 '22 02:11 monkut

I believe I've installed from a private github repository before, this is refering to a private package repository, right?

Hi @monkut, can you explain more detail on this, I got same error with zappa when trying using private repository as dependency. Hope you can help me figure out to fix this

kurojs avatar Jan 16 '23 10:01 kurojs

@kurojs can you post the Zappa version and error logs here?

sridhar562345 avatar Jan 17 '23 10:01 sridhar562345

@kurojs can you post the Zappa version and error logs here?

Hi @sridhar562345, I this is my environments

Zappa version used: 0.56.1 Operating System and Python version: 3.8.10 Poetry version 1.3.1

For the logs, I rolled back already on our staging machine, but something like Django cannot recognize my private git module Seem like when deployed, zappa didn't pack our private module into the zip. Do you have any clues about this, thank you

kurojs avatar Jan 18 '23 02:01 kurojs

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

github-actions[bot] avatar Apr 03 '24 18:04 github-actions[bot]

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.

github-actions[bot] avatar Apr 13 '24 20:04 github-actions[bot]