Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac python wheels #77

Merged
merged 7 commits into from
Mar 13, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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 .github/workflows/clang_format_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
- name: Fetch repository
uses: actions/checkout@v1
- name: Install packages
run: sudo apt-get install python3-venv
run: sudo apt-get update && sudo apt-get install python3-venv
- name: check_clang_format
run: ci/check_clang_format.sh
2 changes: 1 addition & 1 deletion .github/workflows/coverage_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Get submodules
run: git submodule update --init --force --recursive
- name: Install packages
run: sudo apt-get install build-essential libhdf5-dev lcov
run: sudo apt-get update && sudo apt-get install build-essential libhdf5-dev lcov
- name: Build and run unittests
run: ci/coverage_test.sh
- name: Upload Coverage to Coveralls
Expand Down
17 changes: 9 additions & 8 deletions ci/python_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@

set -euxo pipefail

VENV=build/venv-python-test
VENV=$(pwd)/build/venv-python-test/

if [[ ! -d "$VENV" ]]; then
# We use virtualenv instead of venv for python2 tests
pip install virtualenv
virtualenv "$VENV"
fi

set +u # ignore errors in virtualenv's activate
source "$VENV/bin/activate"
set -u
BIN=$VENV/bin/

pip install --upgrade pip
$BIN/pip -v install --upgrade pip setuptools wheel

# install
pip install .
pip install nose
nosetests python
$BIN/pip -v install --force .
$BIN/pip install nose

# prevent the $REPO_ROOT/libsonata/ directory from interfering with the tests
cd python
$BIN/nosetests -s -v
19 changes: 19 additions & 0 deletions libsonata/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Needed so that mac wheels properly delocate:
# https://github.com/matthew-brett/delocate/issues/22

from libsonata._libsonata import (EdgePopulation,
EdgeStorage,
ElementsDataFrame,
ElementsReportPopulation,
ElementsReportReader,
NodePopulation,
NodeStorage,
Selection,
SomasDataFrame,
SomasReportPopulation,
SomasReportReader,
SonataError,
SpikePopulation,
SpikeReader,
version,
)
2 changes: 1 addition & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ endif()
pybind11_add_module(sonata_python SYSTEM bindings.cpp)

set_target_properties(sonata_python PROPERTIES
OUTPUT_NAME "libsonata"
OUTPUT_NAME "_libsonata"
)

target_link_libraries(sonata_python
Expand Down
2 changes: 1 addition & 1 deletion python/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ void bindReportReader(py::module& m, const std::string& prefix) {
}


PYBIND11_MODULE(libsonata, m) {
PYBIND11_MODULE(_libsonata, m) {
py::class_<Selection>(m,
"Selection",
"ID sequence in the form convenient for querying attributes")
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def run(self):
author="BlueBrain Project, EPFL",
author_email="[email protected]",
classifiers=[],
ext_modules=[CMakeExtension("libsonata")],
ext_modules=[CMakeExtension("libsonata._libsonata")],
cmdclass=lazy_dict(
build_ext=CMakeBuild,
test_ext=CMakeBuild,
Expand All @@ -166,5 +166,8 @@ def run(self):
zip_safe=False,
setup_requires=setup_requires,
install_requires=install_requires,
use_scm_version=True,
use_scm_version={"local_scheme": "no-local-version",
mgeplf marked this conversation as resolved.
Show resolved Hide resolved
},
packages=['libsonata',
],
)