Skip to content

Commit

Permalink
Merge pull request #92 from se7entyse7en/go-porting
Browse files Browse the repository at this point in the history
Go porting
  • Loading branch information
se7entyse7en authored Jun 27, 2020
2 parents b5a1945 + dbda5be commit 3fec50f
Show file tree
Hide file tree
Showing 56 changed files with 1,968 additions and 1,292 deletions.
9 changes: 6 additions & 3 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ current_version = 0.5.0
commit = True
tag = False

[bumpversion:file:pydockenv/__init__.py]
[bumpversion:file:meta.json]

[bumpversion:file:cmd/root.go]

[bumpversion:file:HISTORY.md]
search = ## Unreleased
replace = ## [v{new_version} - {now:%Y-%m-%d}](https://github.com/se7entyse7en/pydockenv/compare/v{current_version}...v{new_version})

replace = ## Unreleased
-
- ## [v{new_version} - {now:%Y-%m-%d}](https://github.com/se7entyse7en/pydockenv/compare/v{current_version}...v{new_version})
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[flake8]
max-complexity = 10
exclude = setup.py,.tox
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
### Go ###
bin/pydockenv_exec*

# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
4 changes: 1 addition & 3 deletions .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ order_by_type=True
lines_after_imports=2
indent=' '
atomic=True
known_docker=docker
known_first_party=pydockenv,tests
sections=STDLIB,THIRDPARTY,DOCKER,FIRSTPARTY,LOCALFOLDER
sections=STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
default_section=THIRDPARTY
24 changes: 10 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
dist: xenial
language: python
python:
- "3.6"
- "3.7"
- "3.8"

services:
- docker

before_install:
- pip install .
# For some reason if this is not done before, the image won't be pulled.
# This is not required when running locally.
- docker pull alpine/socat:latest

script:
- python -m unittest discover
matrix:
include:
- language: go
script: echo "TO DO"
- language: python
before_script:
- pip install -r requirements-dev.txt
script:
- flake8
- isort -rc -c -vb
12 changes: 12 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# HISTORY

## Unreleased

### Changed

- Removed commands `load`, `save` and `export` to be re-added/ported into `go` as well
- [documentation] Updated the "Installation", "Development" and "Examples" sections of the README
- [internal] Ported all the code from `python` to `go`:
- easier installation: no more issues with interpreter version used and potential packages conflict
- easier development setup: no meta usage
- deeper integration with docker


## [v0.5.0 - 2019-10-20](https://github.com/se7entyse7en/pydockenv/compare/v0.4.1...v0.5.0)

### Added
Expand Down
52 changes: 41 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
TWINE_CONFIG_FILE ?= .pypirc

clean:
clean-compile:
rm -f bin/pydockenv_exec*
clean-build:
rm -rf dist
check:
flake8 --config .flake8
isort -rc -c $(git ls-tree -r HEAD --name-only | grep "\.py")
build: clean check
python setup.py sdist bdist_wheel

compile-linux-i686: GOOS = linux
compile-linux-i686: GOARCH = 386
compile-linux-x86_64: GOOS = linux
compile-linux-x86_64: GOARCH = amd64
compile-darwin: GOOS = darwin
compile-darwin: GOARCH = amd64
compile-linux-i686 compile-linux-x86_64 compile-darwin: clean-compile
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -o bin/pydockenv_exec_$(GOOS)_$(GOARCH)

compile-all: compile-linux-i686 compile-linux-x86_64 compile-darwin

compile-dev: clean-compile
go build -o bin/pydockenv_exec

build-linux-i686: PLAT_NAME = manylinux1_i686
build-linux-i686: EXEC_SUFFIX = _linux_386
build-linux-i686: compile-linux-i686
build-linux-x86_64: PLAT_NAME = manylinux1_x86_64
build-linux-x86_64: EXEC_SUFFIX = _linux_amd64
build-linux-x86_64: compile-linux-x86_64
build-darwin: PLAT_NAME = macosx_10_4_x86_64
build-darwin: EXEC_SUFFIX = _darwin_amd64
build-darwin: compile-darwin
build-linux-i686 build-linux-x86_64 build-darwin: clean-build
mv bin/pydockenv_exec{$(EXEC_SUFFIX),}
python setup.py bdist_wheel --plat-name $(PLAT_NAME)
rm bin/pydockenv_exec

build-all: build-linux-i686 build-linux-x86_64 build-darwin

publish-check:
@if [[ $$(git rev-parse --abbrev-ref HEAD) != "master" ]]; then \
Expand All @@ -25,10 +52,10 @@ publish-pypi:
twine check dist/*
twine upload --config-file $(TWINE_CONFIG_FILE) --repository $(PYPI_REPOSITORY) dist/*

publish-test: PYPI_REPOSITORY=testpypi
publish-test: build publish-pypi
publish: PYPI_REPOSITORY=pypi
publish: build publish-check publish-pypi
publish-test: PYPI_REPOSITORY = testpypi
publish-test: build-all publish-pypi
publish: PYPI_REPOSITORY = pypi
publish: build-all publish-check publish-pypi
git push origin --tags

bump-major: PART = major
Expand All @@ -38,4 +65,7 @@ bump-patch: PART = patch
bump-major bump-minor bump-patch:
bumpversion $(PART)

.PHONY: clean check build publish-check publish bump-major bump-minor bump-patch
.PHONY: clean-compile clean-build \
compile-linux-i686 compile-linux-x86_64 compile-darwin compile-all compile-dev \
build-linux-i686 build-linux-x86_64 build-darwin build-all \
publish-check publish bump-major bump-minor bump-patch
Loading

0 comments on commit 3fec50f

Please sign in to comment.