Skip to content

Commit

Permalink
Removing pyinstaller for setup.py. Prepping for push to pypi and gett…
Browse files Browse the repository at this point in the history
…ing into repositories

* Move version checking to top of makefile to be injected
* Move to using setup.py --version to get version in circleci
* Always build the binaries so they can be manually tested if needed
  • Loading branch information
drGrove committed Jun 29, 2019
1 parent 7a1a475 commit 3381945
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 167 deletions.
65 changes: 5 additions & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,20 @@ jobs:
name: Setup
command: |
make setup
mkdir output
- persist_to_workspace:
root: ~/mtls-cli
paths:
- .coveragerc
- .git/*
- .tmp/*
- bin
- bin/*
- Makefile
- Pipfile
- Pipfile.lock
- README.md
- build/*
- dist/*
- mtls.spec
- mtls/**/*
- output/*
- password_word_list
- requirements.txt
- scripts/*
Expand All @@ -114,47 +111,6 @@ jobs:
name: Lint
command: make lint

build-package-linux:
executor: linux
working_directory: ~/mtls-cli
steps:
- attach_workspace:
at: ~/mtls-cli
- pip_install
- run:
name: Package
command: |
make pkg SIGN=0
mkdir -p output
mv "mtls-Linux-$(cat VERSION).tar.gz" output/
- run:
name: Test Packaged mtls
command: make run-build
- store_artifacts:
path: output/

build-package-macos:
executor: osx
working_directory: ~/mtls-cli
steps:
- attach_workspace:
at: ~/mtls-cli
- brew
- pip_install:
dir: /Users/distiller/.local/share/virtualenvs/
key: osx
- run:
name: Package
command: |
make pkg SIGN=0
mkdir -p output
mv "mtls-Darwin-$(cat VERSION).tar.gz" output/
- run:
name: Test Packaged mtls
command: make run-build
- store_artifacts:
path: output/

build-package-pypi:
executor: linux
working_directory: ~/mtls-cli
Expand All @@ -167,7 +123,7 @@ jobs:
command: pipenv lock -r > requirements.txt
- run:
name: Create Distribution
command: make pgk-pypy
command: make pkg-pypi
- store_artifacts:
path: dist/

Expand Down Expand Up @@ -228,7 +184,7 @@ workflows:
- lint:
<<: *filter_all_tags
requires:
- init
- init
# - test:
# <<: *filter_all_tags
# requires:
Expand All @@ -237,18 +193,7 @@ workflows:
# <<: *filter_all_tags
# requires:
# - init
- build-package-linux:
<<: *filter_only_tags
requires:
- lint
# - test
- build-package-macos:
<<: *filter_only_tags
requires:
- lint
# - test-macos
- build-package-pypi:
<<: *filter_only_tags
<<: *filter_all_tags
requires:
- build-package-linux
- build-package-macos
- lint
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PIP_ENV:=$(shell pipenv --venv)
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
DESTDIR ?= ~/.local/bin/
SIGN := 1
VERSION := $(shell pipenv run python3 setup.py --version)

ifeq ($(OS),Windows_NT)
UNAME := Windows
Expand Down Expand Up @@ -53,7 +54,7 @@ build: setup
@pipenv run python setup.py build

run:
@$(PIP_ENV)/bin/python3 cli.py $(ARGS)
@pipenv run python3 bin/mtls $(ARGS)

run-build:
@./mtls-$(UNAME)/mtls $(ARGS)
Expand All @@ -78,7 +79,7 @@ ifeq ($(SIGN), 1)
@echo "Signing binary"
@gpg --sign --detach-sign --output mtls-$(UNAME)/mtls.sig mtls-$(UNAME)/mtls
endif
@tar -zcvf mtls-$(UNAME)-$$(cat VERSION).tar.gz mtls-$(UNAME)
@tar -zcvf mtls-$(UNAME)-$(VERSION).tar.gz mtls-$(UNAME)

pkg-pypi: build
@pipenv run python setup.py sdist bdist_wheel
Expand Down
1 change: 0 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
PyInstaller = "==3.4"
black = "==19.3b0"
pycodestyle = "==2.5.0"
coverage = "==4.5.2"
Expand Down
35 changes: 1 addition & 34 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 0 additions & 67 deletions mtls.spec

This file was deleted.

6 changes: 3 additions & 3 deletions mtls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

__author__ = "Danny Grove <danny@drgrovellc.com>"

# Allows "import mtls" and "from mtls import <name>".
sys.path.extend([os.path.join(os.path.dirname(__file__), "..")])

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
__version__ = "dev"

# Allows "import mtls" and "from mtls import <name>".
sys.path.extend([os.path.join(os.path.dirname(__file__), "..")])

from .cli import cli # noqa
from .mtls import MutualTLS # noqa

0 comments on commit 3381945

Please sign in to comment.