Skip to content

Commit

Permalink
Merge branch bundle-dependencies
Browse files Browse the repository at this point in the history
key 0.3 release changes
- bundle all dependencies
- standalone apps via pyinstaller
- macos & linux packaging
- dependency upgrades
- swap stdlib Sqlite -> APSW
  • Loading branch information
rcoup committed Mar 4, 2020
1 parent faa5915 commit 9410329
Show file tree
Hide file tree
Showing 87 changed files with 4,962 additions and 734 deletions.
6 changes: 4 additions & 2 deletions .ackrc
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
### Directories to ignore

--ignore-directory=is:.benchmarks
--ignore-directory=is:build
--ignore-directory=is:coverage
--ignore-directory=is:data
--ignore-directory=is:dist
--ignore-directory=is:tests/data
--ignore-directory=is:vendor
--ignore-directory=is:coverage
--ignore-directory=is:venv
--ignore-directory=match:/\.pytest/
--ignore-directory=is:.benchmarks

### Files to ignore
--ignore-file=is:pytest.xml
Expand Down
17 changes: 9 additions & 8 deletions .buildkite/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ set -e

# install test requirements
echo "--- Installing test requirements..."
pip install \
-r requirements-test.txt
/venv/bin/pip install --no-deps --no-cache \
-r requirements/test.txt

# run the actual test suite
echo "+++ Running test suite..."
chmod a+wrx ./ ./tests/
cd tests
gosu sno pytest \
chmod a+rwx ./ ./tests/
su sno -c "\
/venv/bin/pytest \
--verbose \
-p no:sugar \
--cov-report term \
--cov-report html:../coverage \
--junit-xml=../pytest.xml \
-o cache_dir=/tmp/pytest_cache --cache-clear
--cov-report html:coverage \
--junit-xml=pytest.xml \
-o cache_dir=/tmp/pytest_cache \
--cache-clear"
56 changes: 55 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
**/__pycache__
**/*.pyc
**/*.pyo
*.egg-info/

**/*.pyd
**/*.so
!vendor/wheelhouse/*.so

.coverage
.coverage.*
Expand All @@ -20,7 +22,52 @@ pytest.xml
build/
dist/
venv/
vendor/

vendor/curl/**
!/vendor/curl/Makefile
!/vendor/curl/*.tar.gz
vendor/gdal/**
!/vendor/gdal/Makefile
!/vendor/gdal/*.tar.gz
vendor/geos/**
!/vendor/geos/Makefile
!/vendor/geos/*.tar.bz2
vendor/git/**
!/vendor/git/Makefile
!/vendor/git/*.tar.gz
vendor/jsonc/**
!/vendor/jsonc/Makefile
!/vendor/jsonc/*.tar.gz
vendor/libgit2/**
!/vendor/libgit2/Makefile
!/vendor/libgit2/*.tar.gz
vendor/proj/**
!/vendor/proj/Makefile
!/vendor/proj/*.tar.gz
!/vendor/proj/*.zip
vendor/pygit2/**
!/vendor/pygit2/Makefile
!/vendor/pygit2/*.tar.gz
vendor/spatialindex/**
!/vendor/spatialindex/Makefile
!/vendor/spatialindex/*.tar.gz
vendor/spatialite/**
!/vendor/spatialite/Makefile
!/vendor/spatialite/*.tar.gz
vendor/sqlite/**
!/vendor/sqlite/Makefile
!/vendor/sqlite/*.tar.gz
vendor/.ccache/
vendor/env/**
!vendor/env/share/
vendor/build/

.github/

requirements/.*.installed

Brewfile.lock.json
.venv.mk

.buildkite/

Expand All @@ -31,3 +78,10 @@ HomebrewFormula/
gitea/

tests/

platforms/windows/
platforms/macos/build/
platforms/macos/dist/
platforms/linux/build/
platforms/linux/dist/
platforms/linux/.cache/
52 changes: 0 additions & 52 deletions .github/workflows/homebrew-devel.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/homebrew-stable.yml

This file was deleted.

42 changes: 41 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,45 @@
*.py?
/data
/venv
/vendor
/requirements/.*.installed

vendor/curl/**
!vendor/curl/Makefile
vendor/gdal/**
!vendor/gdal/Makefile
vendor/geos/**
!vendor/geos/Makefile
vendor/git/**
!vendor/git/Makefile
vendor/jsonc/**
!vendor/jsonc/Makefile
vendor/libgit2/**
!vendor/libgit2/Makefile
vendor/proj/**
!vendor/proj/Makefile
vendor/pygit2/**
!vendor/pygit2/Makefile
vendor/spatialindex/**
!vendor/spatialindex/Makefile
vendor/spatialite/**
!vendor/spatialite/Makefile
vendor/sqlite/**
!vendor/sqlite/Makefile
vendor/.ccache/
vendor/env/
vendor/wheelhouse/
vendor/dist/
vendor/build/

/platforms/windows/
/platforms/macos/build/
/platforms/macos/dist/
/platforms/linux/build/
/platforms/linux/dist/
/platforms/linux/.cache/
/platforms/linux/.docker-sno-fpm
/platforms/linux/sqlite3

/tests/data/*/
/tests/data/*.zip
/coverage
Expand All @@ -11,3 +49,5 @@ pytest.xml
/.pytest*
/dist
/build
Brewfile.lock.json
.venv.mk
3 changes: 3 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Authors::

Koordinates Limited
4 changes: 4 additions & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This needs to be kept in sync with HomebrewFormula/sno.rb
brew "cmake"
brew "pkg-config"
brew "python" # Python3
54 changes: 10 additions & 44 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,67 +6,33 @@ We welcome all contributions, bug reports, and suggestions!

### macOS

Requirements (install via Homebrew/somehow):
* Python 3.7
* wget
* cmake

```console
$ git clone git@github.com:koordinates/sno.git
$ cd sno
$ brew install --only-dependencies --HEAD HomebrewFormula/sno.rb

# create our virtualenv
$ python3 -m venv --clear ./venv
$ source venv/bin/activate

# install python dependencies
$ pip install pygdal=="$(gdal-config --version).*"
$ pip install -r requirements-dev.txt

# get libgit2/pygit2 stuff
$ mkdir vendor
$ git clone --branch=kx-0.28 git@github.com:koordinates/libgit2.git vendor/libgit2
$ git clone --branch=kx-0.28 git@github.com:koordinates/pygit2.git vendor/pygit2

# build libgit2
$ pushd vendor/libgit2
$ export LIBGIT2=$VIRTUAL_ENV
$ cmake . -DCMAKE_INSTALL_PREFIX=$LIBGIT2
$ make
$ make install
$ popd

# build pygit2
$ pushd vendor/pygit2
$ export LIBGIT2=$VIRTUAL_ENV
$ export LDFLAGS="-Wl,-rpath,'$LIBGIT2/lib' $LDFLAGS"
$ pip install .
$ popd

# install sno
$ pip install -e .
# make sno globally accessible
$ ln -sf $(pwd)/venv/bin/sno /usr/local/bin/sno

# quit the virtualenv
$ deactivate

# check it's working
$ sno --version
Sno v0.3.0.dev0
GDAL v2.4.2
Sno v0.2.1.dev0
GDAL v3.0.3
PyGit2 v0.28.2; Libgit2 v0.28.2
```

Sources:
* [pygit2: libgit2 within a virtual environment](https://www.pygit2.org/install.html#libgit2-within-a-virtual-environment)

### Docker

```console
$ git clone git@github.com:koordinates/sno.git
$ cd sno
$ docker build -t sno .
$ make docker
# in your repository directory
$ /path/to/sno/sno-docker.sh sno --version
Sno v0.3.0.dev0
GDAL v2.4.2
Sno v0.2.1.dev0
GDAL v3.0.3
PyGit2 v0.28.2; Libgit2 v0.28.2
```

Expand Down
Loading

0 comments on commit 9410329

Please sign in to comment.