Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
72b60f4
Integrate CFFI into setuptools
pmiettinen May 14, 2019
62a9cc4
Upgrade setuptools
pmiettinen May 15, 2019
46c2fbe
tox: remove explicit call to parse_float.py
pmiettinen May 15, 2019
b030fcc
Add sbp.jit to packages and rework parse_float_c importing
pmiettinen May 15, 2019
b02503a
Numba Ahead-Of-Time
pmiettinen May 16, 2019
33cd89f
Distinct module names for different Python versions
pmiettinen May 17, 2019
6f17e36
Remove CFFI dependency
pmiettinen May 17, 2019
3a01cbe
piksi_tools dev branch
pmiettinen May 17, 2019
1f7c7d6
Update benchmark threshold to 1.4
pmiettinen May 17, 2019
aa3f287
Treat as external module in setup
pmiettinen May 22, 2019
145009e
Remove parse_float module
pmiettinen May 22, 2019
ad4cfd9
Resolve setup.py requirements
pmiettinen May 22, 2019
37a1e3a
Rename CRC table
pmiettinen May 23, 2019
e341a7e
Cleanup
pmiettinen May 23, 2019
1e09b98
Build separate wheel for each supported Python version
pmiettinen May 27, 2019
42bcd8b
Quick and dirty port of deploy.bash to deploy.py for Windows.
Jun 3, 2019
d7e117c
temp 2.5.6
Jun 3, 2019
5559a70
Fix vesion reading on Python 2.7
Jun 4, 2019
2086434
Don't use context version of temp dir
Jun 4, 2019
23cdc63
Fix sbp._version issue without reload
Jun 4, 2019
0c76b49
Support USE_TEST_PYPI flag
Jun 4, 2019
c8ec820
Issue warning for test PyPI
silverjam Jun 4, 2019
1d59df1
Specify python3 for *nix
Jun 4, 2019
1a4f8c5
Install gcc for Linux
Jun 4, 2019
cdcb901
Add support for ARM Linux
silverjam Jun 5, 2019
7d477bd
Docs, ability to build an "any" wheel
silverjam Jun 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ matrix:
- sudo apt-get install python3.5 python3.5-dev
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- sudo pip install tox
- git clone -b master https://github.com/swift-nav/piksi_tools.git ../piksi_tools
- git clone -b pmiettinen/esd-1156-numba-deployment https://github.com/swift-nav/piksi_tools.git ../piksi_tools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix after merge

script: |
pushd haskell
docker build -t sbp2json .
Expand Down
49 changes: 43 additions & 6 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,54 @@ Ubuntu 16.04.
[GitHub](https://github.com/swift-nav/libsbp/releases) and add the
RELEASE_NOTES.md.

7. Distribute release packages: `make dist`. You may need credentials
on the appropriate package repositories. Ignore the GPG error in `stack`,
the package will get uploaded correctly anyway. If the release is
a Python only change it may be appropriate to just publish to PyPI
with `make dist-python` -- we typically update all other supported
languages when we make an official firmware release.
7. Distribute release packages. You can attempt to run all releases
with `make dist` -- this will likely not work through... it is
advisable to run each dist target separately. In particular:

- `make dist-javascript`
- `make dist-haskell`
- `make dist-pdf`
- `make dist-python` (see section on Python below)

You may need credentials on the appropriate package repositories. Ignore the
GPG error in `stack`, the package will get uploaded correctly anyway. If
the release is a Python only change it may be appropriate to just publish to
PyPI with `make dist-python` (see section on Python below) -- we typically
update all other supported languages when we make an official firmware
release.

8. Releases are not only never perfect, they never really end. Please
pay special attention to any downstream projects or users that may
have issues or regressions as a consequence of the release version.

# Distributing Python

Python distribution requires compilation for the JIT accelerated `sbp.jit`
package. This package uses the Python `numba` library, which supports AOT
compilation of a native Python extension. The distributions for each platform
can be created by running the `make dist-python` target on each platform
(Windows, Mac OS X, Linux x86, and Linux ARM through docker).

For example, running this:
```
make dist-python PYPI_USERNAME=swiftnav PYPI_PASSWORD=...
```

...will produce and upload a `.whl` appropriate for that platform. A
wheel that targets any platform (but requires that `numba` be installed)
can be produced and uploaded by running the following command:
```
make dist-python PYPI_USERNAME=swiftnav PYPI_PASSWORD=... LIBSBP_BUILD_ANY=y
```

The Linux ARM build of libsbp can be done either natively, or through docker
via the following set of command:
```
docker build -f python/Dockerfile.arm -t libsbp-arm .
docker run -v $PWD:/work --rm -it libsbp-arm /bin/bash
make dist-python PYPI_USERNAME=swiftnav PYPI_PASSWORD=...
```

# Contributions

This library is developed internally by Swift Navigation. We welcome
Expand Down
23 changes: 15 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# before using it to do Crazy Things.

SHELL := /bin/bash
SWIFTNAV_ROOT := $(shell pwd)
SWIFTNAV_ROOT := $(CURDIR)
MAKEFLAGS += SWIFTNAV_ROOT=$(SWIFTNAV_ROOT)
SBP_SPEC_DIR := $(SWIFTNAV_ROOT)/spec/yaml/swiftnav/sbp/
SBP_TESTS_SPEC_DIR := $(SWIFTNAV_ROOT)/spec/tests/yaml/
Expand Down Expand Up @@ -249,15 +249,22 @@ dist-python:
make -C $(SWIFTNAV_ROOT)/python SBP_VERSION="$(SBP_MAJOR_VERSION).$(SBP_MINOR_VERSION).$(SBP_PATCH_VERSION)" deploy
$(call announce-end,"Finished deploying Python package")

dist: dist-python
$(call announce-begin,"Deploying packages")
dist-javascript:
$(call announce-begin,"Deploying Javascript package")
npm publish
pushd $(SWIFTNAV_ROOT)/haskell
stack sdist
stack upload .
popd
$(call announce-begin,"Finished deploying Javascript package")

dist-haskell:
$(call announce-begin,"Deploying Haskell package")
(cd $(SWIFTNAV_ROOT)/haskell; stack sdist; stack upload .)
$(call announce-begin,"Finished deploying Haskell package")

dist-pdf:
$(call announce-begin,"Deploying PDF documentation")
make pdf_dist
$(call announce-end,"Finished deploying packages")
$(call announce-begin,"Finished deploying PDF documentation")

dist: dist-python dist-javascript dist-haskell dist-pdf

pdf:
$(call announce-begin,"Generating PDF datasheet documentation")
Expand Down
14 changes: 14 additions & 0 deletions python/Dockerfile.arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM balenalib/armv7hf-debian:sid-build

RUN [ "cross-build-start" ]

RUN \
echo Setting up ARM build environment... \
&& apt-get update \
&& apt-get install wget bzip2 build-essential llvm-6.0-dev python3 \
&& update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-6.0 1 \
&& wget -O /tmp/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh \
&& bash /tmp/miniconda.sh -b \
&& rm /tmp/miniconda.sh

ENV PATH=/root/miniconda3/bin:$PATH
2 changes: 1 addition & 1 deletion python/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ include .gitignore
include LICENSE
include tox.ini
include sbp/RELEASE-VERSION
recursive-include sbp/ *.py
recursive-include sbp *.py
prune docs/_build
12 changes: 9 additions & 3 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@

.PHONY: deploy

DEPLOY_PYTHON := $(CURDIR)/deploy.bash
DEPLOY_COMMAND := SBP_VERSION=$(SBP_VERSION) $(SHELL) $(DEPLOY_PYTHON)
ifeq ($(OS),Windows_NT)
PYTHON := python
else
PYTHON := python3
endif

DEPLOY_PYTHON := $(CURDIR)/deploy.py
DEPLOY_COMMAND := $(PYTHON) $(DEPLOY_PYTHON)

deploy: export SBP_VERSION=$(SBP_VERSION)
deploy:
$(DEPLOY_COMMAND)
62 changes: 0 additions & 62 deletions python/deploy.bash

This file was deleted.

Loading