Skip to content

Commit

Permalink
Merge pull request #6 from fragmuffin/develop
Browse files Browse the repository at this point in the history
0.2.0
  • Loading branch information
fragmuffin authored Aug 22, 2017
2 parents 75022b6 + bb0ab66 commit 2680920
Show file tree
Hide file tree
Showing 57 changed files with 8,375 additions and 133 deletions.
230 changes: 119 additions & 111 deletions deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,54 +9,53 @@ this can help.

Method based on the articles:

* http://peterdowns.com/posts/first-time-with-pypi.html and
* https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/
* http://peterdowns.com/posts/first-time-with-pypi.html and
* https://hynek.me/articles/sharing-your-labor-of-love-pypi-quick-and-dirty/


Deployment also heavily uses the `./deploy.sh` script in this folder.
At this time, running `./deploy.sh --help` displays:

```
Usage: ./deploy.sh {build|test|and so on ...}
Usage: ./deploy.sh {build|test|and so on ...}

This script is to maintain a consistent method of deployment and testing.
This script is to maintain a consistent method of deployment and testing.

Deployment target: pygcode 0.1.1.dev0
Deployment target: pygcode 0.2.0

Arguments:
Setup:
setup: Installs packages & sets up environment (requires sudo)
Arguments:
Setup:
setup: Installs packages & sets up environment (requires sudo)

Compiling:
build: Execute setup to build packages (populates ../dist/)
creates both 'sdist' and 'wheel' distrobutions.
Compiling:
build: Execute setup to build packages (populates ../dist/)
creates both 'sdist' and 'wheel' distrobutions.

Virtual Environments:
rmenv py# Remove virtual environment
remkenv py# Remove, then create re-create virtual environment
envprereq py# install environment prerequisites (official PyPi)
Virtual Environments:
lsenv List created virtual environments for this lib
rmenv py# Remove virtual environment
remkenv py# Remove, then create re-create virtual environment
envprereq py# install environment prerequisites (official PyPi)

Deploy:
deploy test Upload to PyPi test server
deploy prod Upload to PyPi (official)
Deploy:
deploy test Upload to PyPi test server
deploy prod Upload to PyPi (official)

Install:
install sdist py# Install from local sdist
install wheel py# Install from local wheel
install pypitest py# Install from PyPi test server
install pypi py# Install from PyPi (official)
Install:
install sdist py# Install from local sdist
install wheel py# Install from local wheel
install pypitest py# Install from PyPi test server
install pypi py# Install from PyPi (official)

Testing:
test dev py# Run tests on local dev in a virtual env
test installed py# Run tests on installed library in virtual env
Testing:
test dev py# Run tests on local dev in a virtual env
test installed py# Run tests on installed library in virtual env

Help:
-h | --help display this help message
Help:
-h | --help display this help message

py#: when referenced above means
'py2' for Python 2.7.12
'py3' for Python 3.5.2
```
py#: when referenced above means
'py2' for Python 2.7.12
'py3' for Python 3.5.2

# PyPi deployment

Expand All @@ -68,82 +67,77 @@ Arguments:

`cat ~/.pypirc`

```
[distutils]
index-servers =
prod
test
[distutils]
index-servers =
prod
test

[prod]
repository = https://upload.pypi.org/legacy/
username=FraggaMuffin
password=secret
[prod]
repository = https://upload.pypi.org/legacy/
username=FraggaMuffin
password=secret

[test]
repository=https://test.pypi.org/legacy/
username=FraggaMuffin
password=secret
```
[test]
repository=https://test.pypi.org/legacy/
username=FraggaMuffin
password=secret

`chmod 600 ~/.pypirc`


## Build and Test `sdist` and `wheel`

**Build**
```
./deploy.sh build
```

./deploy.sh build

**Test `sdist`**
```
# Python 2.x
./deploy.sh remkenv py2
./deploy.sh envprereq py2
./deploy.sh install sdist py2
./deploy.sh test installed py2
# Python 3.x
./deploy.sh remkenv py3
./deploy.sh envprereq py3
./deploy.sh install sdist py3
./deploy.sh test installed py3
```

# Python 2.x
./deploy.sh remkenv py2
./deploy.sh envprereq py2
./deploy.sh install sdist py2
./deploy.sh test installed py2

# Python 3.x
./deploy.sh remkenv py3
./deploy.sh envprereq py3
./deploy.sh install sdist py3
./deploy.sh test installed py3

**Test `wheel`**
```
# Python 2.x
./deploy.sh remkenv py2
./deploy.sh install wheel py2
./deploy.sh test installed py2

# Python 3.x
./deploy.sh remkenv py3
./deploy.sh install wheel py3
./deploy.sh test installed py3
```
# Python 2.x
./deploy.sh remkenv py2
./deploy.sh install wheel py2
./deploy.sh test installed py2

# Python 3.x
./deploy.sh remkenv py3
./deploy.sh install wheel py3
./deploy.sh test installed py3



## Upload to PyPi Test server

```
./deploy.sh deploy test
```

./deploy.sh deploy test


**Test**
```
# Python 2.x
./deploy.sh remkenv py2
./deploy.sh envprereq py2
./deploy.sh install pypitest py2
./deploy.sh test installed py2
# Python 3.x
./deploy.sh remkenv py3
./deploy.sh envprereq py3
./deploy.sh install pypitest py3
./deploy.sh test installed py3
```

# Python 2.x
./deploy.sh remkenv py2
./deploy.sh envprereq py2
./deploy.sh install pypitest py2
./deploy.sh test installed py2

# Python 3.x
./deploy.sh remkenv py3
./deploy.sh envprereq py3
./deploy.sh install pypitest py3
./deploy.sh test installed py3

have a look at:
https://testpypi.python.org/pypi/pygcode
Expand All @@ -154,22 +148,19 @@ to make sure it's sane

all good!? sweet :+1: time to upload to 'production'

```
./deploy.sh deploy prod
```
./deploy.sh deploy prod

**Test**
```
# Python 2.x
./deploy.sh remkenv py2
./deploy.sh install pypi py2
./deploy.sh test installed py2
# Python 3.x
./deploy.sh remkenv py3
./deploy.sh install pypi py3
./deploy.sh test installed py3
```

# Python 2.x
./deploy.sh remkenv py2
./deploy.sh install pypi py2
./deploy.sh test installed py2

# Python 3.x
./deploy.sh remkenv py3
./deploy.sh install pypi py3
./deploy.sh test installed py3

have a look at:
https://pypi.python.org/pypi/pygcode
Expand All @@ -178,15 +169,32 @@ to make sure it's sane

# Deployment in Git

merge deployed branch to `master`, then...
create pull request `develop` -> `master`

## Update change log

update [change log](../dist/README.md)

## Push Release to Git (aka `tag`)

merge `develop` branch to `master`, then...

```
git checkout master
git pull
git tag ${version} -m "<change description>"
git push --tags origin master
```
Switch local to `master` and tag with relevant version

have a look at the [releases page](https://github.com/fragmuffin/pygcode/releases) and it should be there.
git checkout master
git pull
git tag ${version} -m "<change description>"
git push --tags origin master

have a look at the
[releases page](https://github.com/fragmuffin/pygcode/releases)
and it should be there.

edit release and copy relevant content from [change log](../dist/README.md)

tadaaaaaa!... go to sleep; it's probably late

# Cleanup

./deploy.sh rmenv py2
./deploy.sh rmenv py3
8 changes: 7 additions & 1 deletion deployment/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Arguments:
creates both 'sdist' and 'wheel' distrobutions.
Virtual Environments:
lsenv List created virtual environments for this lib
rmenv py# Remove virtual environment
remkenv py# Remove, then create re-create virtual environment
envprereq py# install environment prerequisites (official PyPi)
Expand Down Expand Up @@ -83,6 +84,10 @@ function build() {
popd
}

function lsenv() {
lsvirtualenv -b | grep ^${LIB_NAME}_
}

function rmenv() {
# Remove virtual environment
set_venv_variables $1
Expand Down Expand Up @@ -210,6 +215,7 @@ case "$1" in
# Valid Commands
setup) setup ;;
build) build ;;
lsenv) lsenv ;;
rmenv) rmenv $2 ;;
remkenv) remkenv $2 ;;
envprereq) envprereq $2 ;;
Expand All @@ -224,4 +230,4 @@ case "$1" in
;;
esac

echo ./${0##*/} completed successfully
#echo ./${0##*/} completed successfully
20 changes: 20 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Change History

## 0.2.0

Moved to `alpha`

Improvements to read more versatile formats

### Improvements

* Tests include a sample-set of gcode files from varying CAM software and authors.
* `lsenv` in deployment script.
* added `GCodeLineNumber` and `GCodeProgramName` (in response to [#5](https://github.com/fragmuffin/pygcode/issues/5)).
* `GCodeCancelCannedCycle` sets machine mode to `None`, and is run first in list of `motion` gcodes.
* Error message for unsupported gcodes is more helpful / relevant.
* Optional whitespace in `Word`, (eg: `X-1.2` and `X -1.2` are now both valid)

### Bugfixes

* [#5](https://github.com/fragmuffin/pygcode/issues/5) Line number in program


## 0.1.2

Changes to accommodate implementation of [grbl-stream](https://github.com/fragmuffin/grbl-stream)
Expand Down
Binary file removed dist/pygcode-0.1.2-py2.py3-none-any.whl
Binary file not shown.
Binary file removed dist/pygcode-0.1.2.tar.gz
Binary file not shown.
Binary file added dist/pygcode-0.2.0-py2.py3-none-any.whl
Binary file not shown.
Binary file added dist/pygcode-0.2.0.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion src/pygcode.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pygcode
Version: 0.1.2
Version: 0.2.0
Summary: Basic g-code parser, interpreter, and encoder library.
Home-page: https://github.com/fragmuffin/pygcode
Author: Peter Boin
Expand Down
2 changes: 1 addition & 1 deletion src/pygcode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 1.x - Development Status :: 5 - Production/Stable
# <any above>.y - developments on that version (pre-release)
# <any above>*.dev* - development release (intended purely to test deployment)
__version__ = "0.1.2"
__version__ = "0.2.0"

__title__ = "pygcode"
__description__ = "Basic g-code parser, interpreter, and encoder library."
Expand Down
Loading

0 comments on commit 2680920

Please sign in to comment.