Skip to content

Commit

Permalink
Merge pull request #58 from oemof/revision/add-tox-github-workflows-s…
Browse files Browse the repository at this point in the history
…rc-directory-ci

Revise the feedinlib structure following the structure of the other oemof packages
  • Loading branch information
uvchik committed Jun 15, 2021
2 parents f5ef50e + 731a6fb commit 0917eaa
Show file tree
Hide file tree
Showing 81 changed files with 1,940 additions and 1,053 deletions.
118 changes: 118 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
version: '{branch}-{build}'
build: off
image: Visual Studio 2019
environment:
global:
COVERALLS_EXTRAS: '-v'
COVERALLS_REPO_TOKEN: COVERALLSTOKEN
matrix:
- TOXENV: check
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
- TOXENV: py36-cover,coveralls
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
- TOXENV: py36-cover,coveralls
TOXPYTHON: C:\Python36-x64\python.exe
PYTHON_HOME: C:\Python36-x64
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '64'
- TOXENV: py36-nocov
TOXPYTHON: C:\Python36\python.exe
PYTHON_HOME: C:\Python36
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '32'
WHEEL_PATH: .tox/dist
- TOXENV: py36-nocov
TOXPYTHON: C:\Python36-x64\python.exe
PYTHON_HOME: C:\Python36-x64
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '64'
WHEEL_PATH: .tox/dist
- TOXENV: py37-cover,coveralls
TOXPYTHON: C:\Python37\python.exe
PYTHON_HOME: C:\Python37
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '32'
- TOXENV: py37-cover,coveralls
TOXPYTHON: C:\Python37-x64\python.exe
PYTHON_HOME: C:\Python37-x64
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '64'
- TOXENV: py37-nocov
TOXPYTHON: C:\Python37\python.exe
PYTHON_HOME: C:\Python37
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '32'
WHEEL_PATH: .tox/dist
- TOXENV: py37-nocov
TOXPYTHON: C:\Python37-x64\python.exe
PYTHON_HOME: C:\Python37-x64
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '64'
WHEEL_PATH: .tox/dist
- TOXENV: py38-cover,coveralls
TOXPYTHON: C:\Python38\python.exe
PYTHON_HOME: C:\Python38
PYTHON_VERSION: '3.8'
PYTHON_ARCH: '32'
- TOXENV: py38-cover,coveralls
TOXPYTHON: C:\Python38-x64\python.exe
PYTHON_HOME: C:\Python38-x64
PYTHON_VERSION: '3.8'
PYTHON_ARCH: '64'
- TOXENV: py38-nocov
TOXPYTHON: C:\Python38\python.exe
PYTHON_HOME: C:\Python38
PYTHON_VERSION: '3.8'
PYTHON_ARCH: '32'
WHEEL_PATH: .tox/dist
- TOXENV: py38-nocov
TOXPYTHON: C:\Python38-x64\python.exe
PYTHON_HOME: C:\Python38-x64
PYTHON_VERSION: '3.8'
PYTHON_ARCH: '64'
WHEEL_PATH: .tox/dist
- TOXENV: py39-cover,coveralls
TOXPYTHON: C:\Python39\python.exe
PYTHON_HOME: C:\Python39
PYTHON_VERSION: '3.9'
PYTHON_ARCH: '32'
- TOXENV: py39-cover,coveralls
TOXPYTHON: C:\Python39-x64\python.exe
PYTHON_HOME: C:\Python39-x64
PYTHON_VERSION: '3.9'
PYTHON_ARCH: '64'
- TOXENV: py39-nocov
TOXPYTHON: C:\Python39\python.exe
PYTHON_HOME: C:\Python39
PYTHON_VERSION: '3.9'
PYTHON_ARCH: '32'
WHEEL_PATH: .tox/dist
- TOXENV: py39-nocov
TOXPYTHON: C:\Python39-x64\python.exe
PYTHON_HOME: C:\Python39-x64
PYTHON_VERSION: '3.9'
PYTHON_ARCH: '64'
WHEEL_PATH: .tox/dist
init:
- ps: echo $env:TOXENV
- ps: ls C:\Python*
install:
- '%PYTHON_HOME%\python -mpip install --progress-bar=off tox -rci/requirements.txt'
- '%PYTHON_HOME%\Scripts\virtualenv --version'
- '%PYTHON_HOME%\Scripts\pip --version'
- '%PYTHON_HOME%\Scripts\tox --version'
test_script:
- %PYTHON_HOME%\Scripts\tox
on_failure:
- ps: dir "env:"
- ps: get-content .tox\*\log\*

### To enable remote debugging uncomment this (also, see: http://www.appveyor.com/docs/how-to/rdp-to-build-worker):
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
24 changes: 24 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[bumpversion]
current_version = 0.0.0
commit = True
tag = True

[bumpversion:file:setup.py]
search = version='{current_version}'
replace = version='{new_version}'

[bumpversion:file (badge):README.rst]
search = /v{current_version}.svg
replace = /v{new_version}.svg

[bumpversion:file (link):README.rst]
search = /v{current_version}...master
replace = /v{new_version}...master

[bumpversion:file:docs/conf.py]
search = version = release = '{current_version}'
replace = version = release = '{new_version}'

[bumpversion:file:src/feedinlib/__init__.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
71 changes: 71 additions & 0 deletions .cookiecutterrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This file exists so you can easily regenerate your project.
#
# `cookiepatcher` is a convenient shim around `cookiecutter`
# for regenerating projects (it will generate a .cookiecutterrc
# automatically for any template). To use it:
#
# pip install cookiepatcher
# cookiepatcher gh:ionelmc/cookiecutter-pylibrary feedinlib
#
# See:
# https://pypi.org/project/cookiepatcher
#
# Alternatively, you can run:
#
# cookiecutter --overwrite-if-exists --config-file=feedinlib/.cookiecutterrc gh:ionelmc/cookiecutter-pylibrary

default_context:

_extensions: ['jinja2_time.TimeExtension']
_template: 'gh:ionelmc/cookiecutter-pylibrary'
allow_tests_inside_package: 'no'
appveyor: 'yes'
c_extension_function: 'longest'
c_extension_module: '_feedinlib'
c_extension_optional: 'no'
c_extension_support: 'no'
c_extension_test_pypi: 'no'
c_extension_test_pypi_username: 'oemof'
codacy: 'no'
codacy_projectid: 'CODACY_ID'
codeclimate: 'no'
codecov: 'no'
command_line_interface: 'plain'
command_line_interface_bin_name: 'feedinlib'
coveralls: 'yes'
coveralls_token: 'COVERALLSTOKEN'
distribution_name: 'feedinlib'
email: 'contact@oemof.org'
full_name: 'oemof developer group'
legacy_python: 'no'
license: 'MIT license'
linter: 'flake8'
package_name: 'feedinlib'
pre_commit: 'yes'
project_name: 'feedinlib'
project_short_description: 'Connect weather data interfaces with interfaces of wind and pv power models.'
pypi_badge: 'yes'
pypi_disable_upload: 'no'
release_date: 'today'
repo_hosting: 'github.com'
repo_hosting_domain: 'github.com'
repo_name: 'feedinlib'
repo_username: 'oemof'
requiresio: 'yes'
scrutinizer: 'no'
setup_py_uses_setuptools_scm: 'no'
setup_py_uses_test_runner: 'no'
sphinx_docs: 'yes'
sphinx_docs_hosting: 'https://feedinlib.readthedocs.io/'
sphinx_doctest: 'no'
sphinx_theme: 'sphinx-rtd-theme'
test_matrix_configurator: 'yes'
test_matrix_separate_coverage: 'yes'
test_runner: 'pytest'
travis: 'no'
travis_osx: 'no'
version: '0.0.0'
version_manager: 'bump2version'
website: 'https://oemof.org'
year_from: '2015'
year_to: '2021'
16 changes: 13 additions & 3 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
[paths]
source = src

[run]
omit = test/*
feedinlib/open_FRED.py
source = feedinlib
branch = true
source =
src
tests
parallel = true

[report]
show_missing = true
precision = 2
omit = *migrations*
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# see https://editorconfig.org/
root = true

[*]
# Use Unix-style newlines for most files (except Windows files, see below).
end_of_line = lf
trim_trailing_whitespace = true
indent_style = space
insert_final_newline = true
indent_size = 4
charset = utf-8

[*.{bat,cmd,ps1}]
end_of_line = crlf

[*.{yml,yaml}]
indent_size = 2

[*.tsv]
indent_style = tab
37 changes: 37 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: packaging

on:
# Make sure packaging process is not broken
push:
branches: [master]
pull_request:
# Make a package for release
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v1
- 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 setuptools setuptools_scm twine wheel
- name: Create packages
run: python setup.py sdist bdist_wheel
- name: Run twine check
run: twine check dist/*
- uses: actions/upload-artifact@v2
with:
name: tox-gh-actions-dist
path: dist
55 changes: 55 additions & 0 deletions .github/workflows/tox_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# NB: this name is used in the status badge
name: tox checks

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
- releases/0.1.0
workflow_dispatch:
schedule:
- cron: "0 5 * * 6" # 5:00 UTC every Saturday

jobs:
lint:
name: ${{ matrix.toxenv }}
runs-on: ubuntu-latest

strategy:
matrix:
toxenv:
- clean
- check
- docs

steps:
- name: Git clone
uses: actions/checkout@v2

- name: Set up Python ${{ env.default_python || '3.9' }}
uses: actions/setup-python@v2
with:
python-version: "${{ env.default_python || '3.9' }}"

- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}-${{ hashFiles('tox.ini', 'setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.toxenv }}-
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools wheel
python -m pip install -U tox
- name: Run ${{ matrix.toxenv }}
run: python -m tox -e ${{ matrix.toxenv }}
44 changes: 44 additions & 0 deletions .github/workflows/tox_pytests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: tox pytests

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
- releases/0.1.0
workflow_dispatch:
schedule:
- cron: "0 5 * * 6" # 5:00 UTC every Saturday

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.9]

steps:
- uses: actions/checkout@v1
- 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 tox tox-gh-actions coverage coveralls
- name: Test with tox
run: tox

- name: Check test coverage
run: coverage report -m --fail-under=${{ matrix.vcs == 'bzr' && 57 || 58 }}

- name: Report to coveralls
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
Loading

0 comments on commit 0917eaa

Please sign in to comment.