diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml new file mode 100644 index 0000000..fa431ed --- /dev/null +++ b/.github/workflows/build-publish.yml @@ -0,0 +1,55 @@ +name: Ubuntu and Mac builds + +on: push + +jobs: + + build_and_publish: + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + + runs-on: ${{ matrix.os }} + if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install pacakges + run: python3 -m pip install --upgrade --upgrade-strategy eager twine cibuildwheel + + #- name: Build and Test + # run: | + # python3 setup.py build_ext --inplace + # python3 -m unittest discover -v -s tests -p "test_*.py" + + - name: Build Wheels + run: | + python3 -m cibuildwheel --output-dir wheelhouse + python3 setup.py sdist + ls -lrt wheelhouse/* + + - uses: actions/upload-artifact@v2 + with: + name: pygeoda-${{ matrix.os }} + path: wheelhouse/ + + - name: Publish to Pypi + if: github.event_name == 'release' && github.event.action == 'created' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python3 -m twine upload wheelhouse/*.whl + + - name: Publish Source to Pypi + if: matrix.os == 'macos-latest' && github.event_name == 'release' && github.event.action == 'created' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python3 -m twine upload dist/*.tar.gz \ No newline at end of file diff --git a/.github/workflows/win-build-publish.yml b/.github/workflows/win-build-publish.yml new file mode 100644 index 0000000..16a8a30 --- /dev/null +++ b/.github/workflows/win-build-publish.yml @@ -0,0 +1,95 @@ +# This is a basic workflow to help you get started with Actions + +name: Windows builds + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [ master ] + pull_request: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + windows_build: + runs-on: windows-latest + #if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')" + + strategy: + matrix: + msvc_arch: + - amd64 + - win32 + + python_ver: + - 3.6 + - 3.7 + - 3.8 + - 3.9 + + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Setup for Python 3.9 + if: "contains(matrix.python_ver, '3.9')" + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.msvc_arch }} + toolset: 14.2 + + - name: Setup for Python 3.6, 3.7, 3.8 + if: "!contains(matrix.python_ver, '3.9')" + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.msvc_arch }} + toolset: 14.1 + + - name: Setup Python Architecture x64 + if: "contains(matrix.msvc_arch, 'amd64')" + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python_ver }} + architecture: 'x64' + + - name: Setup Python Architecture x86 + if: "!contains(matrix.msvc_arch, 'amd64')" + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python_ver }} + architecture: 'x86' + + - name: Build and Test + shell: pwsh + run: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools wheel virtualenv twine + python -m virtualenv venv + venv\\Scripts\\activate + python setup.py build_ext --inplace + python -m unittest + + - name: Build Wheels + shell: pwsh + run: | + venv\\Scripts\\activate + pip wheel -v -w wheelhouse --no-deps . + dir wheelhouse/* + + - uses: actions/upload-artifact@v2 + with: + name: pygeoda-${{ matrix.python_ver }}-${{ matrix.msvc_arch }}-win + path: wheelhouse/ + + - name: Publish to Pypi + if: github.event_name == 'release' && github.event.action == 'created' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python -m twine upload wheelhouse/*.whl diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bea82ab..0000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ -language: python - -jobs: - include: - # perform a linux build - - services: docker - # and a mac build - - os: osx - # PyPy 7.3.2 needs macOS >= 10.14 - osx_image: xcode10.2 - language: shell - -env: - global: - - TWINE_USERNAME=__token__ - # Note: TWINE_PASSWORD is set to a PyPI API token in Travis settings - -install: - - python3 -m pip install --upgrade --upgrade-strategy eager twine cibuildwheel - -script: - # build the wheels, put them into './wheelhouse' - - python3 -m cibuildwheel --output-dir wheelhouse - #- python3 -m pip wheel -v -w wheelhouse --no-deps . - #- auditwheel repair wheelhouse/pygeoda*whl -w output/ - - python3 setup.py sdist - -after_success: - # if the release was tagged, upload them to PyPI - - | - if [[ $TRAVIS_TAG ]]; then - python3 -m pip install twine - python3 -m twine upload wheelhouse/*.whl - python3 -m twine upload dist/*.tar.gz - fi diff --git a/Development.md b/Development.md index fe0164b..9d8b950 100644 --- a/Development.md +++ b/Development.md @@ -7,14 +7,19 @@ Pygeoda for windows is built using Appveyor (see: appveyor.yml) NOTE: -python 3.5.0 msc 1900 visual c++ 2015 msvc14.0 -python 3.6.1 msc 1900 visual c++ 2015 (!!as conda-forge, msvc14.1 for py36) -python 3.7.0 msc 1914 visual c++ 2017 msvc14.1 -python 3.8.1 msc 1916 visual c++ 2017 -python 3.9.1 msc 1928 visual c++ 2019 msvc14.2 +python 3.5.0 msc 1900 visual c++ 2015 msvc14.0 (vs2015) +(NOTE: python3.5 will not be supported on PyPi after 0.0.8-1) + +python 3.6.1 msc 1900 visual c++ 2015 (!!as conda-forge, msvc14.1 for py36) (vs2017) +python 3.7.0 msc 1914 visual c++ 2017 msvc14.1 (vs2017) +python 3.8.1 msc 1916 visual c++ 2017 msvc14.1 (vs2017) +python 3.9.1 msc 1928 visual c++ 2019 msvc14.2 (vs2019) Pygeoda for Linux and Mac OSX is built using Travis (see .travis.yml) + +## conda-forge + For conda-forge, the pygeoda PyPI package is used as the source. So, when updating pygeoda PyPI package, the conda-forge package should be automatically updated. diff --git a/README.md b/README.md index 46b266b..99b25a7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # pygeoda [](https://badge.fury.io/py/pygeoda) -[](https://anaconda.org/conda-forge/pygeoda) + +[](https://anaconda.org/conda-forge/pygeoda) +[](https://anaconda.org/conda-forge/pygeoda) pygeoda is a python library for spatial data analysis based on libgeoda and GeoDa. It provides spatial data analysis functionalities including Exploratory Spatial Data Analysis, Spatial Cluster Detection and Clustering Analysis, Regionalization, etc. based on the C++ source code of GeoDa, which is an open-source software tool that serves as an introduction to spatial data analysis. diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index f3e2f92..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,166 +0,0 @@ -image: - - Visual Studio 2019 - - Visual Studio 2017 - - Visual Studio 2015 - -# Start builds on tags only (GitHub and BitBucket) -skip_non_tags: false - -# Do not build feature branch with open Pull Requests -skip_branch_with_pr: true - -# Maximum number of concurrent jobs for the project -max_jobs: 1 - -environment: - global: - TWINE_USERNAME: "lixun910" - TWINE_PASSWORD: - secure: r1f70+i5UeM8tQYITBMMkQ== - - matrix: - - - PYTHON: "C:\\Python35" - PYTHON_VERSION: "3.5.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python35-x64" - PYTHON_VERSION: "3.5.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python36" - PYTHON_VERSION: "3.6.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python36-x64" - PYTHON_VERSION: "3.6.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python37" - PYTHON_VERSION: "3.7.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python37-x64" - PYTHON_VERSION: "3.7.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python38" - PYTHON_VERSION: "3.8.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python38-x64" - PYTHON_VERSION: "3.8.x" - PYTHON_ARCH: "64" - - - PYTHON: "C:\\Python39" - PYTHON_VERSION: "3.9.x" - PYTHON_ARCH: "32" - - - PYTHON: "C:\\Python39-x64" - PYTHON_VERSION: "3.9.x" - PYTHON_ARCH: "64" - -matrix: - fast_finish: true - - exclude: - - image: Visual Studio 2019 - PYTHON: "C:\\Python35" - - image: Visual Studio 2019 - PYTHON: "C:\\Python35-x64" - - image: Visual Studio 2017 - PYTHON: "C:\\Python35" - - image: Visual Studio 2017 - PYTHON: "C:\\Python35-x64" - - image: Visual Studio 2019 - PYTHON: "C:\\Python36" - - image: Visual Studio 2019 - PYTHON: "C:\\Python36-x64" - - image: Visual Studio 2015 - PYTHON: "C:\\Python36" - - image: Visual Studio 2015 - PYTHON: "C:\\Python36-x64" - - image: Visual Studio 2019 - PYTHON: "C:\\Python37" - - image: Visual Studio 2019 - PYTHON: "C:\\Python37-x64" - - image: Visual Studio 2015 - PYTHON: "C:\\Python37" - - image: Visual Studio 2015 - PYTHON: "C:\\Python37-x64" - - image: Visual Studio 2019 - PYTHON: "C:\\Python38" - - image: Visual Studio 2019 - PYTHON: "C:\\Python38-x64" - - image: Visual Studio 2015 - PYTHON: "C:\\Python38" - - image: Visual Studio 2015 - PYTHON: "C:\\Python38-x64" - - image: Visual Studio 2017 - PYTHON: "C:\\Python39" - - image: Visual Studio 2017 - PYTHON: "C:\\Python39-x64" - - image: Visual Studio 2015 - PYTHON: "C:\\Python39" - - image: Visual Studio 2015 - PYTHON: "C:\\Python39-x64" - -install: - # note: VS 2010 has stdint.h bundled so simply copy it. Cython should not - # depend on it for py27 (works fine when compiling using C code) - # but this works differently for C++ (maybe there is some other issue - # with environment setup). - # try to do a dirty workaround for Cython with C++ for py27 - - ps: >- - if(Test-Path "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h") { - cp "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h" "C:\Users\appveyor\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h" - } - - # Prepend Python to the PATH of this build - - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - # Check that we have the expected version and architecture for Python - - "python --version" - - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" - - # Upgrade to the latest version of pip to avoid it displaying warnings - # about it being out of date. - - "python -m pip install --upgrade pip" - - # Upgrade setuptools, wheel and virtualenv - - "python -m pip install --upgrade setuptools wheel virtualenv" - - # Create new virtual environment and activate it - - "python -m virtualenv venv" - - "venv\\Scripts\\activate" - - "python -c \"import sys; print(sys.executable)\"" - -build_script: - - "echo $env:APPVEYOR_REPO_TAG" - # checkout submodules - - "git submodule update --init --recursive" - # build wheel - - "cd %APPVEYOR_BUILD_FOLDER%" - - "python setup.py build_ext --inplace" - - "pip wheel -v -w wheelhouse --no-deps ." - -test_script: - # install from wheel - - "pip install --no-index --find-links wheelhouse pygeoda" - # run tests against installed package - - "python -m unittest discover -v -s tests -p \"test_*.py\"" - -artifacts: - # Archive the generated wheel package in the ci.appveyor.com build report. - - path: wheelhouse\*.whl - -# deploy wheels to PyPI on tagged commits -deploy_script: - - ps: >- - if($env:APPVEYOR_REPO_TAG -eq 'true') { - Write-Output ("Deploying " + $env:APPVEYOR_REPO_TAG_NAME + " to PyPI...") - pip install --upgrade twine - twine upload wheelhouse/*.whl - } else { - Write-Output "Not deploying as this is not a tagged commit" - } \ No newline at end of file diff --git a/docs/spatial_auto.html b/docs/spatial_auto.html index f6f4d5a..f90f7ce 100644 --- a/docs/spatial_auto.html +++ b/docs/spatial_auto.html @@ -1,43 +1,40 @@ - + +
- + - +