0

I have a common utils repo with a setup.py. I am trying to install this in a new repo using pipenv and am struggling to get it running.

I don't often play with setup.py so am definitely doing something dumb through not understanding so any help would be appreciated.

Common utils repo

Directory structure looks like:

.
├── setup.py
└── src
    └── utils
        ├── __init__.py
        └── utils.py.py

Setup file looks like

#!/usr/bin/env python
# -*- coding: utf-8 -*

from setuptools import find_packages, setup

install_requires = (...)  # some dependencies here

setup(
    name="common_utils",
    version="0.0.1",
    include_package_data=True,
    package_dir={"": "src"},
    packages=find_packages("src", include=["utils"]),
    install_requires=install_requires,
    process_dependency_links=True,
)

New app that needs to access utils

This app has a Pipfile which should reference that should reference the repo

...
[ packages ]
common_utils = { git = "[email protected]:me/utils-repo" }

When I run pipenv install I get the below error:

ipenv.patched.pip._internal.exceptions.InstallationError: Invalid requirement: 'common_utils@ [email protected]:me/utils-repo.git' (from line 2 of ...)
Hint: It looks like a path. File 'common_utils@ [email protected]:me/utils-repo.git' does not exist.

I'd love to know what I'm doing wrong here because I am going to need to set this up in a few places and I definitely don't understand how setup.py builds the utils library.

1
  • Does it make a difference if you specify editable? I.e. { editable = 'true', git = "[email protected]:me/utils-repo" } Commented Jul 18, 2024 at 7:09

1 Answer 1

0

You could try adding the repository as a submodule:

git submodule add --name <repo name> -b <branch name>

If you subsequently need to update the submodule the command is

git submodule update --remote --init

Docs: https://git-scm.com/book/en/v2/Git-Tools-Submodules

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.