hi...python package had a bug, so I had to build t...
# general
d
hi...python package had a bug, so I had to build the package from the github source. I have the egg file now but not sure how to add it as a dependency that can be fetched by centralized server. We are not a python shop, other than having some tooling in python. Do I need to host a Pypi Server or there any other option? Thanks.
e
You just need a shared file server or a web server that can list a flat directory. Place the sdist, egg or wheel in the file server or webserver directory and add the following to your pants.ini:
Copy code
[python_repos]
repos: [
    '/mnt/nfs/cheeseshop',
    '<https://internal.server/cheeseshop>',
  ]
Here I show an example of two internal repos, an NFS mount and an internal web server. You'll probably just want to use one.
I also strongly recommend editing the version of any code customizations you make before building the custom sdist, egg or wheel. Then, in your repo, specify that specific, unique, version.
d
thanks. will try it out.
@enough-analyst-54434 I need a little more help on this. I have edited my pants.ini to
Copy code
[python-repos]
repos: ['/Users/jagas005/Documents/project/incubator-airflow/dist']
indexes: ['<https://pypi.python.org/simple/>']
and have added
Copy code
python_requirement_library(
  name='apache-airflow',
  requirements=[
    python_requirement(name='apache-airflow',
                       requirement='apache-airflow==2.0.0.dev0+incubating'),
])
to the build. I do have the egg file in that location but the build fails with ```
Copy code
Exception message: Could not satisfy all requirements for apache-airflow==2.0.0.dev0+incubating:
    apache-airflow==2.0.0.dev0+incubating
thanks
e
You'll need to turn on pre-release resolution support:
Copy code
$ ./pants python-setup --help-advanced | grep -A1 resolver-allow-prereleases
--[no-]python-setup-resolver-allow-prereleases (default: None)
    Whether to include pre-releases when resolving requirements.
You can set on the command line with
./pants binary --python-setup-resolver-allow-prereleases ...
. You can set this in
pants.ini
with:
Copy code
[python-setup]
resolver_allow_prereleases: True
d
same error.
e
Please run wit
PEX_VERBOSE=5 ./pants ...
and paste the full log
d
sorry.. fixed. Had built the egg file with 3.6 and rest of the code in the pants repo is still at 2.7. Rebuilding egg in a new conda 2.7 environment fixed it.
Thanks again