Skip to content

Commit

Permalink
Use PEP 508 URL formatting for easier Pip install (#471)
Browse files Browse the repository at this point in the history
Thanks to pypa/pip#4187 (comment), we can finally install
Kingpin easily with a simple `pip install` command.
  • Loading branch information
diranged authored Jan 22, 2019
1 parent 31700cb commit 146aa31
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
6 changes: 3 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The simplest installation method is via

.. code-block:: bash
$ pip install --process-dependency-links kingpin
$ pip install kingpin
Note, we *strongly* recommend running the code inside a Python virtual
environment. All of our examples below will show how to do this.
Expand All @@ -28,7 +28,7 @@ Github Checkout/Install
Receiving objects: 100% (1824/1824), 283.35 KiB, done.
Resolving deltas: 100% (1330/1330), done.
(.venv)$ cd kingpin/
(.venv)$ python setup.py install
(.venv)$ pip install .
zip_safe flag not set; analyzing archive contents...
...
Expand All @@ -42,7 +42,7 @@ Direct PIP Install
Installing setuptools, pip...done.
$ source .venv/bin/activate
(.venv) $ git clone https://github.com/Nextdoor/kingpin
(.venv)$ pip install --process-dependency-links git+https://github.com/Nextdoor/kingpin.git
(.venv)$ pip install git+https://github.com/Nextdoor/kingpin.git
Downloading/unpacking git+https://github.com/Nextdoor/kingpin.git
Cloning https://github.com/Nextdoor/kingpin.git (to master) to /var/folders/j6/qyd2dp6n3f156h6xknndt35m00010b/T/pip-H9LwNt-build
...
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ retrying
#
# NOTE: Version specified in the setup.py file
# NOTE: mock is used inside the rightscale actor
python-rightscale>=0.1.7
python-rightscale @ https://github.com/diranged/python-rightscale-1/tarball/nextdoor#egg=python-rightscale-0.1.7
mock==1.0.1

# kingpin.actors.aws
Expand Down
15 changes: 10 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def maybe_rm(path):
os.remove(path)


def read_requirements(requirements):
"""Parse requirements from requirements.txt."""
reqs_path = requirements
with open(reqs_path, 'r') as f:
requirements = [line.rstrip() for line in f]
return requirements


class Pep8Command(Command):
description = 'Pep8 Lint Checks'
user_options = []
Expand Down Expand Up @@ -161,12 +169,9 @@ def run(self):
keywords='apache',
packages=find_packages(),
test_suite='nose.collector',
tests_require=open('%s/requirements.test.txt' % DIR).readlines(),
tests_require=read_requirements('%s/requirements.test.txt' % DIR),
setup_requires=[],
install_requires=open('%s/requirements.txt' % DIR).readlines(),
dependency_links=[
'https://github.com/diranged/python-rightscale-1/tarball/nextdoor#egg=python-rightscale-0.1.7'
],
install_requires=read_requirements('%s/requirements.txt' % DIR),
entry_points={
'console_scripts': [
'kingpin = kingpin.bin.deploy:begin'
Expand Down

0 comments on commit 146aa31

Please sign in to comment.