Skip to content

Commit

Permalink
Merge pull request #90 from apriha/develop
Browse files Browse the repository at this point in the history
v4.0.1
  • Loading branch information
apriha authored Mar 31, 2021
2 parents a7deba8 + e87382c commit 7d9fc5c
Show file tree
Hide file tree
Showing 8 changed files with 455 additions and 342 deletions.
131 changes: 131 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# https://docs.github.com/en/actions
# https://github.com/codecov/example-python
# https://stackoverflow.com/a/3237883
# https://stackoverflow.com/a/5688592
# https://stackoverflow.com/a/6270803
# https://github.com/actions/virtual-environments/issues/1341

name: CI

on:
schedule:
- cron: '37 3 * * 0'
push:
branches: '**'
pull_request:
branches: '**'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install Black
run: |
pip install black==19.10b0
- name: Lint with Black
run: |
black --check --diff .
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install Sphinx
run: |
pip install sphinx sphinx-rtd-theme
pip install .
- name: Build docs with Sphinx
run: |
sphinx-build -W --keep-going -T -E -D language=en docs docs/_build
test:
needs: [lint, build-docs]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
python-version: 3.6
job_id: 0
- os: ubuntu-latest
python-version: 3.7
job_id: 1
- os: ubuntu-latest
python-version: 3.8
job_id: 2
- os: ubuntu-latest
python-version: 3.9
job_id: 3
- os: macos-latest
python-version: 3.9
job_id: 4
- os: windows-latest
python-version: 3.9
job_id: 5

steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set default for downloads
shell: bash
run: echo "DOWNLOADS_ENABLED=false" >> $GITHUB_ENV
- name: Determine if downloads are enabled for this job
# for testing, limit downloads from the resource servers to only the selected job for
# PRs and the master branch; note that the master branch is tested weekly via `cron`,
# so this ensures all Python versions will be periodically integration tested with the
# resource servers
env:
NUM_JOBS: 6
JOB_ID: ${{ matrix.job_id }}
if: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/master' }}
shell: bash
run: |
SELECTED_JOB=$((10#$(date +%V) % $NUM_JOBS))
if [[ $SELECTED_JOB == $JOB_ID ]]; then
# set environment variable to download resources for selected job
echo "DOWNLOADS_ENABLED=true" >> $GITHUB_ENV
fi
- name: Install dependencies
shell: bash
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
pip install pytest-cov awscli
pip install .
if [[ $DOWNLOADS_ENABLED == "false" ]]; then
# use cached resources on Amazon S3
aws s3 cp s3://lineage-resources/resources.tar.gz resources.tar.gz
if [[ -f resources.tar.gz ]]; then
tar -xzf resources.tar.gz
rm resources.tar.gz
fi
fi
- name: Ensure Python and source code are on same drive (Windows)
if: ${{ matrix.os == 'windows-latest' }}
shell: cmd
run: |
mkdir C:\a
xcopy D:\a C:\a /s /e
- name: Test with pytest (Ubuntu & macOS)
if: ${{ matrix.os != 'windows-latest' }}
run: |
pytest --cov=lineage tests
- name: Test with pytest (Windows)
if: ${{ matrix.os == 'windows-latest' }}
working-directory: C:\a\lineage\lineage
run: |
pytest --cov=lineage tests
- name: Upload coverage to Codecov (Ubuntu & macOS)
if: ${{ matrix.os != 'windows-latest' }}
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will upload a Python Package using Twine when a release is published
# For more information see: https://docs.github.com/en/actions/guides/building-and-testing-python#publishing-to-package-registries

name: Deploy

on:
release:
types: [published]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
83 changes: 0 additions & 83 deletions .travis.yml

This file was deleted.

25 changes: 25 additions & 0 deletions LICENSES-3RD-PARTY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,28 @@ Specifically, both are released under the Creative Commons "Public Domain
Dedication" license (CC0-1.0), as described in
https://creativecommons.org/publicdomain/zero/1.0/ .
-------------------------------------------------------------------------------
This license applies to GitHub Actions code.

MIT License

Copyright (c) 2020 GitHub

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

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 OR COPYRIGHT HOLDERS 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. THIS LICENSE DOES NOT GRANT YOU RIGHTS TO USE ANY CONTRIBUTORS'
NAME, LOGO, OR TRADEMARKS.
-------------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include LICENSES-3RD-PARTY.txt
include README.rst
include versioneer.py

exclude .git* .travis*
exclude .git*

prune docs/images
prune docs/_build
Expand Down
Loading

0 comments on commit 7d9fc5c

Please sign in to comment.