Unverified Commit e62d100b authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Clean-up for code review (#28)

* Updated python setup

* Relicense to CC-0

* Moved to github actions

* Fixed license language

* Fix recipe cmake pin
parent e0bfc184
Loading
Loading
Loading
Loading
+61 −0
Original line number Diff line number Diff line
name: CMake

on: [push, pull_request]

env:
  # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
  BUILD_TYPE: Release

jobs:
  build-library:

    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        python-version: ["3.7", "3.8", "3.9", "3.10"]
    defaults:
      run:
        shell: bash -l {0}
    env:
      SSPICE_DEBUG: y
    steps:
    - uses: actions/checkout@v2
    - uses: conda-incubator/setup-miniconda@v2
      with:
          miniconda-version: "latest"
          activate-environment: csmswig
          environment-file: environment.yml
          python-version: ${{ matrix.python-version }}
          auto-activate-base: false
          auto-update-conda: true

    - name: Conda info
      run: |
          conda info
          conda list

    - name: Create Build Environment
      # Some projects don't allow in-source building, so createa  separate build directory
      # we'll use it as our working directory for subsequent commands.
      run: cmake -E make_directory ${{github.workspace}}/build

    - name: Configure CMake
      working-directory: ${{github.workspace}}/build
      run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE

    - name: Build wrapper
      working-directory: ${{github.workspace}}/build
      # Execute the build.  You can specify a specific target with "--target <NAME>"
      run: cmake --build . --config $BUILD_TYPE

    - name: Install wrapper
      working-directory: ${{github.workspace}}/build/python
      # Execute the build.  You can specify a specific target with "--target <NAME>"
      run: python setup.py install

    - name: Test
      working-directory: ${{github.workspace}}/build/python
      # Execute tests defined by the CMake configuration.
      # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
      run: ctest -VV -C $BUILD_TYPE
 No newline at end of file

.travis.yml

deleted100644 → 0
+0 −63
Original line number Diff line number Diff line
language: generic

os: 
  - linux
  - osx

env:
  - PYTHON_VERSION=3.5
  - PYTHON_VERSION=3.6
  - PYTHON_VERSION=3.7

before_install:
  # Install a supported cmake version (>= 3.10)
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
    else
      curl -o miniconda.sh  https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh;
    fi
  - bash miniconda.sh -b -p $HOME/miniconda
  - export PATH="$HOME/miniconda/bin:$PATH"

  # Set up the env
  - conda create -q -n test -y python=$PYTHON_VERSION
  - source activate test

  # Add the necessary channels
  - conda config --add channels usgs-astrogeology
  - conda config --add channels conda-forge

install:
# Setup to do the build 
  - conda env update -n test -f environment.yml
  - conda install -c conda-forge -y pytest
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      conda install -y -c conda-forge/label/gcc7 python=$PYTHON_VERSION
      conda install -y gcc_linux-64 gxx_linux-64;
    else
      conda install -y -c conda-forge python=$PYTHON_VERSION
    fi

script:
  - mkdir build && cd build
  - cmake .. && make
  - cd python && python setup.py install && cd ..
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      pytest python/tests/ --lib fixture/libfixturecsm.so;
    else
      pytest python/tests/ --lib fixture/libfixturecsm.dylib;
    fi
    
after_success:
  # - source deactivate
  - conda install -y -q conda-build anaconda-client
  - cd ../  # Step out of the python dir and out of the build dir
  - if [ "${TRAVIS_PULL_REQUEST}" = "false" ] ;then
      conda config --set anaconda_upload yes;
      conda build --token $CONDA_UPLOAD_TOKEN --python $PYTHON_VERSION recipe -q;
    else
      conda build recipe -q;
    fi
+4 −2
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.14)

project(swigcsm VERSION 1.0.1 DESCRIPTION "SWIG wrappers for the Community Sensor Model API")

find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
include(UseSWIG)

add_subdirectory(python)
add_subdirectory(fixture)
 No newline at end of file

LICENSE.md

0 → 100644
+44 −0
Original line number Diff line number Diff line
Unless otherwise noted, this project is in the public domain in the
United States.

It contains materials that originally came from the United States
Geological Survey, an agency of the United States Department of
Interior.  For more information on their copyright policies, see
https://www.usgs.gov/information-policies-and-instructions/copyrights-and-credits

It also contains materials from contributors that have waived their
copyright interest to the public domain.

Additionally, the authors waive copyright and related rights in the
work worldwide through the CC0 1.0 Universal public domain dedication.

CC0 1.0 Universal Summary
-------------------------

This is a human-readable summary of the [Legal Code (read the full
text)](https://creativecommons.org/publicdomain/zero/1.0/legalcode).


### No Copyright

The authors have associated their contributions to the swigcsm project
with this deed, and have dedicated the work to the public domain
by waiving all of their rights to the work worldwide under copyright
law, including all related and neighboring rights, to the extent
allowed by law.

You can copy, modify, distribute and perform the work, even for
commercial purposes, all without asking permission.


### Other Information

In no way are the patent or trademark rights of any person affected
by CC0, nor are the rights that other persons may have in the work
or in how the work is used, such as publicity or privacy rights.

Unless expressly stated otherwise, the authors who have associated
the swigcsm project with this deed make no warranties about the work,
and disclaim liability for all uses of the work, to the fullest
extent permitted by applicable law. When using or citing the work,
you should not imply endorsement by the authors.

LICENSE.txt

deleted100644 → 0
+0 −24
Original line number Diff line number Diff line
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
Loading