-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from phobson/more-gh-actions-part2
More GH actions part2
- Loading branch information
Showing
24 changed files
with
192 additions
and
59 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Coverage via codecov | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Generate coverage report | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest pytest-cov pytest-mpl coverage docopt | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
pip install scipy | ||
export MPL_IMGCOMP_TOLERANCE=35 | ||
coverage run --source cloudside check_cloudside.py --doctest-modules --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
# directory: ./coverage/reports/ | ||
flags: unittests | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
path_to_write_report: ./codecov_report.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflows will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Upload Python Package to PyPI | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
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.PMH_PYPI_USER }} | ||
TWINE_PASSWORD: ${{ secrets.PMH_PYPI_PASS }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Run basic unit tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
if [ -f requirements_dev.txt ]; then pip install -r requirements_dev.txt; fi | ||
- name: Test with pytest | ||
run: | | ||
python check_cloudside.py --runslow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Image comparison tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest pytest-mpl docopt | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Test with pytest | ||
run: | | ||
export MPL_IMGCOMP_TOLERANCE=37 | ||
python check_cloudside.py --mpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
# std lib stuff | ||
import datetime | ||
import logging | ||
import warnings | ||
from ftplib import FTP, error_perm | ||
|
@@ -8,7 +7,7 @@ | |
|
||
import numpy | ||
import pandas | ||
from metar import Metar, Datatypes | ||
from metar import Metar | ||
|
||
from . import validate | ||
|
||
|
@@ -118,7 +117,7 @@ def _fetch_file( | |
past_attempts=0, | ||
max_attempts=10, | ||
): | ||
""" Fetches a single file from the ASOS ftp and returns its pathh on the | ||
"""Fetches a single file from the ASOS ftp and returns its pathh on the | ||
local file system | ||
Parameters | ||
|
@@ -192,7 +191,7 @@ def fetch_files( | |
force_download=False, | ||
pbar_fxn=None, | ||
): | ||
""" Fetches a single file from the ASOS ftp and returns its path on the | ||
"""Fetches a single file from the ASOS ftp and returns its path on the | ||
local file system | ||
Parameters | ||
|
@@ -234,7 +233,7 @@ def fetch_files( | |
|
||
|
||
def _find_reset_time(precip_ts): | ||
""" Determines the precipitation gauge's accumulation reset time. | ||
"""Determines the precipitation gauge's accumulation reset time. | ||
Parameters | ||
---------- | ||
|
@@ -265,7 +264,7 @@ def get_idxmin(g): | |
|
||
|
||
def _process_precip(data, rt, raw_precipcol): | ||
""" Processes precip data that accumulates hourly into raw minute | ||
"""Processes precip data that accumulates hourly into raw minute | ||
intensities. | ||
Parameters | ||
|
@@ -300,7 +299,7 @@ def _process_precip(data, rt, raw_precipcol): | |
|
||
|
||
def parse_file(filepath, new_precipcol="precipitation"): | ||
""" Parses a raw ASOS/METAR file into a pandas.DataFrame | ||
"""Parses a raw ASOS/METAR file into a pandas.DataFrame | ||
Parameters | ||
---------- | ||
|
@@ -342,7 +341,7 @@ def get_data( | |
force_download=False, | ||
pbar_fxn=None, | ||
): | ||
""" Download and process a range of FAA/ASOS data files for a given station | ||
"""Download and process a range of FAA/ASOS data files for a given station | ||
Parameters | ||
---------- | ||
|
@@ -373,7 +372,7 @@ def get_data( | |
-------- | ||
>>> from cloudside import asos | ||
>>> from tqdm import tqdm | ||
>>> pdx = asos.get_data('KPDX', '2010-10-01', '2013-10-31', my_email, | ||
>>> pdx = asos.get_data('KPDX', '2013-09-01', '2013-10-31', '[email protected]', | ||
... folder='Portland_weather', raw_folder='asos_files', | ||
... force_download=False, pbar_fxn=tqdm) | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import warnings | ||
|
||
import numpy | ||
import pandas | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
from functools import wraps | ||
from contextlib import contextmanager | ||
|
||
import cloudside | ||
|
||
try: | ||
import pytest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from datetime import datetime | ||
import pathlib | ||
import tempfile | ||
import ftplib | ||
|
Oops, something went wrong.