Skip to content

Commit

Permalink
Add support for github-ci and add admin for standard releasing proced…
Browse files Browse the repository at this point in the history
…ures

Signed-off-by: Adam.Dybbroe <a000680@c21856.ad.smhi.se>
  • Loading branch information
Adam.Dybbroe committed May 19, 2021
1 parent 4447837 commit 0eeb23e
Show file tree
Hide file tree
Showing 9 changed files with 218 additions and 4 deletions.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#### Code Sample, a minimal, complete, and verifiable piece of code

```python
# Your code here

```
#### Problem description

[this should also explain **why** the current behaviour is a problem and why the
expected output is a better solution.]

#### Expected Output

#### Actual Result, Traceback if applicable

#### Versions of Python, package at hand and relevant dependencies


Thank you for reporting an issue !
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Describe what your PR does, and why -->

- [ ] Closes #xxxx <!-- remove if there is no corresponding issue, which should only be the case for minor changes -->
- [ ] Tests added <!-- for all bug fixes or enhancements -->
- [ ] Tests passed: Passes ``pytest pyspectral`` <!-- for all non-documentation changes) -->
- [ ] Passes ``flake8`` <!-- remove if you did not edit any Python files -->
- [ ] Fully documented <!-- remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later -->
90 changes: 90 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: true
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.7", "3.8", "3.9"]
experimental: [false]
include:
- python-version: "3.9"
os: "ubuntu-latest"
experimental: true

env:
PYTHON_VERSION: ${{ matrix.python-version }}
OS: ${{ matrix.os }}
UNSTABLE: ${{ matrix.experimental }}
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
mamba-version: "*"
channels: conda-forge,defaults
environment-file: continuous_integration/environment.yaml
activate-environment: test-environment

- name: Install unstable dependencies
if: matrix.experimental == true
shell: bash -l {0}
run: |
python -m pip install \
-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com \
--no-deps --pre --upgrade \
dask \
numpy \
xarray \
h5netcdf; \
python -m pip install \
--no-deps --upgrade \
git+https://github.com/pytroll/pyspectral \
git+https://github.com/pytroll/trollsift \
git+https://github.com/pytroll/satpy \
git+https://github.com/pytroll/pyorbital;
- name: Install level1c4pps
shell: bash -l {0}
run: |
pip install --no-deps -e .
- name: Run unit tests
shell: bash -l {0}
run: |
pytest --cov=level1c4pps level1c4pps/tests --cov-report=xml --cov-report=
- name: Upload unittest coverage to Codecov
uses: codecov/codecov-action@v1
with:
flags: unittests
file: ./coverage.xml
env_vars: OS,PYTHON_VERSION,UNSTABLE
fail_ci_if_error: false

- name: Coveralls Parallel
uses: AndreMiras/coveralls-python-action@develop
with:
flag-name: run-${{ matrix.test_number }}
parallel: true
if: runner.os == 'Linux'

coveralls:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: AndreMiras/coveralls-python-action@develop
with:
parallel-finished: true
25 changes: 25 additions & 0 deletions .github/workflows/deploy-sdist.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy sdist

on:
release:
types:
- published

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Create sdist
shell: bash -l {0}
run: python setup.py sdist

- name: Publish package to PyPI
if: github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@v1.4.1
with:
user: __token__
password: ${{ secrets.pypi_password }}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Version <v0.2.2> (2021/05/19)

13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# level1c4pps
Tools to generate NWCSAF/PPS level-1C formattet netCDF files from various agency specific level-1 formats.
So far supports
level1c4pps
===========

[![Build status](https://github.com/foua-pps/level1c4pps/workflows/CI/badge.svg?branch=main)](https://github.com/foua-pps/level1c4pps/workflows/CI/badge.svg?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/foua-pps/level1c4pps/badge.svg)](https://coveralls.io/github/foua-pps/level1c4pps)


Tools to generate NWCSAF/PPS level-1C formattet netCDF files from various
agency specific level-1 formats. So far, supports

- EUMETSAT Meteosat Second Generation SEVIRI HRIT level-1.5
- NOAA AVHRR GAC
- MERSI-2 level-1
Expand Down
37 changes: 37 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Releasing activefires-pp

prerequisites: `pip install setuptools twine`


1. checkout main
2. pull from repo
3. run the unittests
4. run `loghub` and update the `CHANGELOG.md` file:

```
loghub foua-pps/level1c4pps --token <personal access token (see https://github.com/settings/tokens)> -st v<previous version> -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes"
```

Don't forget to commit!

5. Create a tag with the new version number, starting with a 'v', eg:

```
git tag -a v0.1.1 -m "Version 0.1.1"
```

See [semver.org](http://semver.org/) on how to write a version number.


6. push changes to github `git push --follow-tags`

7. Verify the Github actions unit tests passed

8. Create a "Release" on GitHub by going to
https://github.com/adybbroe/activefires-pp/releases and clicking "Draft a new
release". On the next page enter the newly created tag in the "Tag version"
field, "Version X.Y.Z" in the "Release title" field, and paste the markdown
from the changelog (the portion under the version section header) in the
"Describe this release" box. Finally click "Publish release".

9. Verify the GitHub actions for deployment succeed and the release is on PyPI
26 changes: 26 additions & 0 deletions continuous_integration/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: test-environment
channels:
- conda-forge
dependencies:
- distributed
- toolz
- sphinx
- dask
- pyyaml
- pyproj
- coveralls
- coverage
- codecov
- behave
- mock
- numpy
- xarray
- satpy
- pyspectral
- h5netcdf
- pyorbital
- pytest
- pytest-cov
- pip
- pip:
- trollsift
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"""Scripts to convert various satellite level-1 data formats to NWCSAF/PPS level-1c format."""

from setuptools import setup
from setuptools import find_packages

try:
# HACK: https://github.com/pypa/setuptools_scm/issues/190#issuecomment-351181286
Expand Down Expand Up @@ -53,7 +54,7 @@
"Programming Language :: Python",
"Topic :: Scientific/Engineering"],
url="https://github.com/foua-pps/level1c4pps",
packages=['level1c4pps', ],
packages=find_packages(),
scripts=['bin/seviri2pps.py',
'bin/gac2pps.py',
'bin/mersi22pps.py',
Expand Down

0 comments on commit 0eeb23e

Please sign in to comment.