When I run:
pip install git+ssh://[email protected]/developer/sdk-python.git@master#egg=sdk-python
I see this output:
Cloning ssh://[email protected]/developer/sdk-python.git (to revision master) to /private/var/folders/k1/h29nn0z959q0dr6b44kxx_8h0000gn/T/pip-install-txsz9E/sdk-python
Generating metadata for package sdk-python produced metadata for project name sdk. Fix your #egg=sdk-python fragments.
Requirement already satisfied: requests in ./venv27/lib/python2.7/site-packages (from sdk) (2.21.0)
Requirement already satisfied: python-dateutil in ./venv27/lib/python2.7/site-packages (from sdk) (2.8.0)
Requirement already satisfied: certifi>=2017.4.17 in ./venv27/lib/python2.7/site-packages (from requests->sdk) (2018.11.29)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in ./venv27/lib/python2.7/site-packages (from requests->sdk) (3.0.4)
Requirement already satisfied: idna<2.9,>=2.5 in ./venv27/lib/python2.7/site-packages (from requests->sdk) (2.8)
Requirement already satisfied: urllib3<1.25,>=1.21.1 in ./venv27/lib/python2.7/site-packages (from requests->sdk) (1.24.1)
Requirement already satisfied: six>=1.5 in ./venv27/lib/python2.7/site-packages (from python-dateutil->sdk) (1.12.0)
Building wheels for collected packages: sdk, sdk
Building wheel for sdk (setup.py) ... done
Stored in directory: /private/var/folders/k1/h29nn0z959q0dr6b44kxx_8h0000gn/T/pip-ephem-wheel-cache-twLUBT/wheels/e5/b9/06/c754f4c2a0a2b191960dabcfc6f1dc7d0bb231e844cf4a032e
Building wheel for sdk (setup.py) ... error
Complete output from command /Users/me/git/sdk-python-test/venv27/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/k1/h29nn0z959q0dr6b44kxx_8h0000gn/T/pip-install-txsz9E/sdk/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/k1/h29nn0z959q0dr6b44kxx_8h0000gn/T/pip-wheel-OIQ_lk --python-tag cp27:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/private/var/folders/k1/h29nn0z959q0dr6b44kxx_8h0000gn/T/pip-install-txsz9E/sdk/setup.py'
----------------------------------------
Failed building wheel for sdk
Running setup.py clean for sdk
Complete output from command /Users/me/git/sdk-python-test/venv27/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/k1/h29nn0z959q0dr6b44kxx_8h0000gn/T/pip-install-txsz9E/sdk/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
Traceback (most recent call last):
File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/private/var/folders/k1/h29nn0z959q0dr6b44kxx_8h0000gn/T/pip-install-txsz9E/sdk/setup.py'
----------------------------------------
Failed cleaning build dir for sdk
Successfully built sdk
Failed to build sdk
Installing collected packages: sdk
Successfully installed sdk-1.0.0
It looks to me as if sdk-python installed. I can even see it if I do pip list
. However, I don't understand the errors. Other similar posts suggest missing depedencies but I ca't see anything that's missing.
Can anybody tell me what's wrong?
Below is my setup.py. I believe it is correct but it's my first time creating one so I based it mstly on something I found online so it may not be correct. If there is anything obviously wrong with it I'd be keen to hear what that is.
#!/usr/bin/env python
import os
import re
import sys
from setuptools import setup, find_packages
# sdk python version check
_valid = sys.version_info[:2] == (2,7) or sys.version_info >= (3,4)
if not _valid:
sys.exit("Sorry, SDK only supports versions 2.7, 3.4, 3.5, 3.6, 3.7 of python.")
ROOT = os.path.dirname(__file__)
VERSION_RE = re.compile(r'''__version__ = ['"]([a-z0-9._-]+)['"]''')
requirements = [
'requests',
'python-dateutil'
]
def get_version():
init = open(os.path.join(ROOT, 'sdk', '__init__.py')).read()
return VERSION_RE.search(init).group(1)
setup(
name='sdk',
version=get_version(),
description='SDK for Python',
long_description=open('README.md').read(),
author='me',
url='https://github.mycompany.com/developer/sdk-python',
scripts=[],
packages=find_packages(exclude=['tests*']),
include_package_data=True,
install_requires = requirements,
license="Apache License 2.0",
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
)
Additional Info
It installs without issue if I run this:
pip install -e git+ssh://[email protected]/developer/sdk-python.git@master#egg=sdk-python
Should I be including the -e
? I always thought it was optional and only would have used it if I wanted to edit the package.
The name in my setup.py
is sdk
but the name I use for my egg is sdk-python
. These should be the same from what I can tell.
I changed my command to this and it worked:
pip install -e git+ssh://[email protected]/developer/sdk-python.git@master#egg=sdk