Unable to get pip and setuptools to agree

Viewed 145

I've been working on splitting my code out into various modules and packages.

After changing one of my libraries to a git submodule I'm not able to get both pip and setuptools to be able to install.

I've done a few things to get this to work and I eventually figured I must just be doing it wrong. So I tried doing it with Poetry. However I get the same result there.

So if I do this in my poetry config:

packages = [
    { include = "sophoscli.py" },
    { include = "sophosApi" },
]

[tool.poetry.dependencies]
python = ">=3.8"
sophosapi = {path = "./sophosApi"}

then

poetry build

then try to install the packages it generates I get: pip._vendor.pkg_resources.RequirementParseError: Invalid URL: sophosApi and setuptools is unable to install it as well.

The setup.py poetry generates is:

# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['sophosApi', 'sophosApi.docs.source', 'sophosApi.sophosApi']

package_data = \
{'': ['*'], 'sophosApi': ['docs/*']}

modules = \
['sophoscli']
install_requires = \
['sophosapi @ sophosApi']

setup_kwargs = {
    'name': 'sophoscli',
    'version': '1.0.0',
    'description': 'Cli for sophosApi',
    'long_description': None,
    'author': '',
    'author_email': '',
    'maintainer': None,
    'maintainer_email': None,
    'url': '',
    'packages': packages,
    'package_data': package_data,
    'py_modules': modules,
    'install_requires': install_requires,
    'python_requires': '>=3.8',
}


setup(**setup_kwargs)

Before I tried poetry, I noticed I was able to get setup tools to work if I did:

install_requires = ['sophosApi']
dependency_links = [f"""{os.path.join(os.getcwd(), 'sophosApi')}#egg=sophosApi-1.0.0""",]

but then pip would still not work.

Is there a way to get this to work when sophosApi is it's own package?

0 Answers
Related