Skip to content

Commit

Permalink
Merge pull request #6 from aaratn/create_pip_package
Browse files Browse the repository at this point in the history
Add support for python-pip
  • Loading branch information
aaratn authored Feb 7, 2020
2 parents 90e35f6 + 15741fa commit b279fd1
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 44 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
PLATFORM?=linux_x64

build:
@PYTHONOPTIMIZE=1 pyinstaller terraenv.py --onefile --clean --osx-bundle-identifier com.aarat.os.terraenv --nowindowed
@PYTHONOPTIMIZE=1 pyinstaller terraenv --onefile --clean --osx-bundle-identifier com.aarat.os.terraenv --nowindowed
@chmod +x dist/terraenv

package:
@cd dist && tar -czvf ./terraenv_$(PLATFORM).tar.gz terraenv
@cd dist && tar -czvf ./terraenv_$(PLATFORM).tar.gz terraenv

build-pip:
@rm -rf dist/
@python3 setup.py bdist_wheel

upload-pip-test:
@python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*

upload-pip:
@python3 -m twine upload dist/*
79 changes: 41 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Install via Homebrew on OSx
$ brew tap aaratn/terraenv
$ brew install terraenv
```

### Upgrade

via Homebrew on OSx
Expand All @@ -49,6 +50,7 @@ via Homebrew on OSx


2. Extract Tar Archive

Linux
```console
$ tar -xvzf terraenv_linux_x64.tar.gz
Expand All @@ -57,6 +59,7 @@ via Homebrew on OSx
```console
$ tar -xvzf terraenv_osx_x64.tar.gz
```

3. Copy the extracted file to your `/usr/local/bin` directory

```console
Expand Down Expand Up @@ -110,18 +113,18 @@ List installed versions

```console
% terraenv terraform list local
0.12
0.11.13
0.11.14
0.12.11
0.12.0
0.12.12
0.12.13
0.12
0.11.13
0.11.14
0.12.11
0.12.0
0.12.12
0.12.13
```
```console
% terraenv terragrunt list local
0.18.7
0.21.6
0.18.7
0.21.6
```

### terraenv <terraform/terragrunt> list remote
Expand All @@ -130,35 +133,35 @@ List installable versions

```console
% terraenv terraform list remote
...
0.11.3
0.11.4
0.11.5
0.11.6
0.11.7
0.11.8
0.11.9
0.11.10
0.11.11
0.11.12
0.11.13
0.11.14
0.12.0
0.12.1
0.12.2
0.12.3
0.12.4
0.12.5
0.12.6
0.12.7
0.12.8
0.12.9
0.12.10
0.12.11
0.12.12
0.12.13
0.12.14
0.12.15
...
0.11.3
0.11.4
0.11.5
0.11.6
0.11.7
0.11.8
0.11.9
0.11.10
0.11.11
0.11.12
0.11.13
0.11.14
0.12.0
0.12.1
0.12.2
0.12.3
0.12.4
0.12.5
0.12.6
0.12.7
0.12.8
0.12.9
0.12.10
0.12.11
0.12.12
0.12.13
0.12.14
0.12.15
```

## .terraenv file
Expand Down
Empty file added __init__.py
Empty file.
2 changes: 1 addition & 1 deletion commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import platform
import requests
from zipfile import ZipFile
from config import DOWNLOAD_PATH, VERSION_FILE
from commons.config import DOWNLOAD_PATH, VERSION_FILE
from .list import list_remote

""" Download Required Terraform / Terragrunt Versions """
Expand Down
2 changes: 1 addition & 1 deletion commands/list.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from requests_html import HTMLSession
from distutils.version import StrictVersion
import json
from config import DOWNLOAD_PATH
from commons.config import DOWNLOAD_PATH
import os

validate_versions_commands = ['install', 'uninstall', 'use']
Expand Down
2 changes: 1 addition & 1 deletion commands/uninstall.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dotenv import load_dotenv
import os.path
import os
from config import DOWNLOAD_PATH, VERSION_FILE
from commons.config import DOWNLOAD_PATH, VERSION_FILE
from .list import list_local
import sys

Expand Down
2 changes: 1 addition & 1 deletion commands/use.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os.path
import os
import sys
from config import DOWNLOAD_PATH, VERSION_FILE
from commons.config import DOWNLOAD_PATH, VERSION_FILE
from .list import list_local

def use(args):
Expand Down
Empty file added commons/__init__.py
Empty file.
File renamed without changes.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ urllib3==1.25.7
virtualenv==16.1.0
w3lib==1.21.0
websockets==8.1
twine==3.1.1
setuptools<45.0.0
50 changes: 50 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import setuptools

with open("README.md", "r") as fh:
long_description = fh.read()

setuptools.setup(
name="terraenv",
version="0.7",
author="Aarat Nathwani",
author_email="me@aarat.com",
description="Terraform and Terragrunt Version Manager",
long_description=long_description,
long_description_content_type='text/markdown',
url="https://github.com/aaratn/terraenv",
packages=setuptools.find_packages(),
license='MIT',
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
scripts=['terraenv'],
install_requires=[
"altgraph==0.16.1",
"appdirs==1.4.3",
"beautifulsoup4==4.8.1",
"bs4==0.0.1",
"certifi==2019.9.11",
"chardet==3.0.4",
"cssselect==1.1.0",
"fake-useragent==0.1.11",
"idna==2.8",
"lxml==4.4.1",
"macholib==1.11",
"parse==1.12.1",
"pyee==6.0.0",
"pyppeteer==0.0.25",
"pyquery==1.4.1",
"python-dotenv==0.10.3",
"requests==2.22.0",
"requests-html==0.10.0",
"six==1.13.0",
"soupsieve==1.9.5",
"tqdm==4.38.0",
"urllib3==1.25.7",
"w3lib==1.21.0",
"websockets==8.1"
]
)
File renamed without changes.

0 comments on commit b279fd1

Please sign in to comment.