Skip to content

Commit

Permalink
Merge pull request #694 from htm-community/verifywheel
Browse files Browse the repository at this point in the history
Verify Wheel
  • Loading branch information
breznak authored Oct 3, 2019
2 parents d48ca47 + f779ef8 commit e6520f3
Show file tree
Hide file tree
Showing 14 changed files with 449 additions and 497 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/htmcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ jobs:
name: "dist-${{ matrix.os }}"
path: build/Release/distr/dist

- name: Test python package is working
shell: bash
run: |
python -m pip uninstall -y htm.core
filePath=$(ls build/Release/distr/dist/*.whl)
python -m pip install --force $filePath
python -m pytest bindings/py/tests
publish-pypi:
name: Publish package to PYPI
Expand All @@ -105,29 +113,32 @@ jobs:
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
name: dist-ubuntu-18.04
path: dist1/
path: dist/

- uses: actions/download-artifact@master
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
name: dist-macOs-latest
path: dist2/
path: dist/

- uses: actions/download-artifact@master
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
with:
name: dist-windows-2019
path: dist3/
path: dist/

- name: pre-PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
#copy dist data to /dist, where PyPI Action expects it
run: |
ls dist*
cd dist
mv `ls -1 htm*-linux_*.whl` `ls -1 htm*-linux_*.whl | sed -e's/linux/manylinux1/'` #rename to manylinux1 to make PYPI accept the package
rm *.egg #remove obsoleted egg format
cd ..
ls dist/
- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') && matrix.os == 'ubuntu-18.04' && 1==0
#FIXME temp disabled as pypi-publisher action must run on Linux only!
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*.swp
*.pyc
*.pkl
__pycache__

# Coverage files
.coverage
Expand All @@ -30,6 +31,7 @@ htm.core.kdev4
# Build files
build/
junit-test-results.xml
VERSION

# Test Output files
bindings/py/tests/*.stream
Expand Down
28 changes: 9 additions & 19 deletions bindings/py/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,23 @@

## Layout of directories:
```
Repository
bindings
REPO_DIR external -- cmake scripts to download/build dependancies
bindings
py -- Location of Python bindings
packaging -- Contains things needed to build package
cpp_src
bindings -- C++ pybind11 mapping source code
plugin -- C++ code to manage python plugin
tests -- Unit test for python interface
tests -- Unit test for python interface py htm -- python source code goes here tests src htm -- C++ source code goes here examples tests build -- where all things modified by the build are placed (disposible) ThirdParty -- where all thirdParty packages are installed. scripts -- temporary build files Release -- Where things are installed
```

## This is where we build the distribution package:
```
Repository
REPO_DIR
build
scripts --- CMake build artifacts are in here.
Release
bin --- Contains executables for unit tests and examples
include --- Include C++ header files
lib --- Static & Dynamic compiled libraries for htm core found here
distr --- Python distribution (packaging directory copied here)
setup.py
requirements.txt
dist --- pip egg is generated here
htm --- Pure python code is copied to here
src
htm --- Python library assembled here
bindings --- C++ extension libraries installed here
regions
tools
```
bin --- Contains executables for unit tests and examples
include --- Include C++ header files
lib --- Static & Dynamic compiled libraries for htm core found here
- distr ( copy from REPO_DIR/bindings/py/packaging/* by CMake)
/ build -- setup.py; setup() puts stuff in here / dist -- setup.py; setup() puts stuff in here | dummy.c | requirements.txt ( copy from REPO_DIR/requirements.txt by setup.py; setup()) | src --setup.py; setup() will look in here for packages, should find htm, tests | htm ( copy from REPO_DIR/py/htm/* by CMake) | advanced | algorithms | bindings ( copy from REPO_DIR/bindings/py/packaging/bindings/* by CMake) | __init__.py ( copy from REPO_DIR/bindings/py/packaging, by CMake) | *.pyd (the extension libraries from CMake build) | check.py Package used regions to build tools Wheel encoders | examples ( copy from REPO_DIR/bindings/py/packaging/examples/* by CMake) \ optimization ( copy form REPO_DIR/py/htm/optimization by CMake) \ README.md ( copy form REPO_DIR/py/htm by CMake) - utils_test.py ```
Expand Down
6 changes: 4 additions & 2 deletions bindings/py/cpp_src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,10 @@ source_group("test" FILES ${src_py_test_files})
# setup the distr directory
set(distr ${CMAKE_INSTALL_PREFIX}/distr)
file(MAKE_DIRECTORY ${distr})
file(COPY ../packaging/. DESTINATION ${distr} PATTERN *)
file(COPY ${REPOSITORY_DIR}/py/. DESTINATION ${distr}/src PATTERN *)
file(COPY ${REPOSITORY_DIR}/bindings/py/packaging/. DESTINATION ${distr} REGEX ".*__pycache__" EXCLUDE)
#file(COPY ${REPOSITORY_DIR}/bindings/py/tests/. DESTINATION ${distr}/src/htm/tests REGEX ".*__pycache__" EXCLUDE)
file(COPY ${REPOSITORY_DIR}/py/htm/. DESTINATION ${distr}/src/htm REGEX ".*__pycache__" EXCLUDE)
#file(COPY ${REPOSITORY_DIR}/py/tests/. DESTINATION ${distr}/src/htm/tests REGEX ".*__pycache__" EXCLUDE)

# determine which version of binding to build
if ("${BINDING_BUILD}" STREQUAL "Python2")
Expand Down
Loading

0 comments on commit e6520f3

Please sign in to comment.