Skip to content

Commit

Permalink
Merge pull request #60 from fluves/update-version
Browse files Browse the repository at this point in the history
Update CI with recent
  • Loading branch information
stijnvanhoey authored Feb 18, 2023
2 parents bc7e6ee + f6613fa commit c843ff2
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 33 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/binder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@ on:
jobs:
Create-Binder-Badge:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:

- name: checkout pull request branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: comment on PR with Binder link
uses: actions/github-script@v1
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
var BRANCH_NAME = process.env.BRANCH_NAME;
github.issues.createComment({
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
var PR_HEAD_REF = process.env.PR_HEAD_REF;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${context.repo.owner}/${context.repo.repo}/${BRANCH_NAME}) :point_left: Launch a binder notebook on this branch`
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}) :point_left: Launch a binder notebook on branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_`
})
env:
BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
fail-fast: [false]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -34,7 +34,7 @@ jobs:
run: |
python -m pip install --upgrade pre-commit
pre-commit run --all-files
if: matrix.python-version == '3.7'
if: matrix.python-version == '3.9'
- name: Test with pytest
env:
HIC_TOKEN: ${{ secrets.HIC_TOKEN }}
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Get all git tags
run: git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Get all git tags
run: git fetch --prune --unshallow --tags
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ exclude: '^docs/conf.py'

repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.1.0
hooks:
- id: black
language_version: python3.7
language_version: python3.9

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand All @@ -23,8 +23,8 @@ repos:
- id: mixed-line-ending
args: ['--fix=no']

- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: ['--max-line-length=88'] # default of Black
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ classifiers =
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Expand Down
4 changes: 2 additions & 2 deletions src/pywaterinfo/waterinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def request_kiwis(self, query: dict, headers: dict = None) -> dict:
>>> # get the API info/documentation from kiwis
>>> data, res = vmm.request_kiwis({"request": "getRequestInfo"})
>>> data #doctest: +ELLIPSIS
[{'Title': 'KISTERS QueryServices - Request Inform...file'}}}}}}]
[{'Title': 'KISTERS QueryServices - Request Inform...}}}}}]
>>> res.status_code
200
>>> # get the timeseries data from last day from time series 78124042
Expand Down Expand Up @@ -245,7 +245,7 @@ def _check_query_parameters(self, query):
else:
optional_parameters = set()

for (parameter, _) in query.items():
for parameter, _ in query.items():
if parameter not in (
supported_parameters | optional_parameters | set(self._default_params)
):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def test_cache_retention(patch_retention):
assert not res.from_cache

time.sleep(1)
vmm = Waterinfo("vmm")
_, res = vmm.request_kiwis({"request": "getRequestInfo"})
print(res.from_cache, res.created_at, res.expires, res.is_expired)
assert res.is_expired

vmm._request.remove_expired_responses()
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = pywaterinfo

[tox]
minversion = 3.15
envlist = py37,py38,py39
envlist = py{37,38,39,310,311}
skip_missing_interpreters=true


Expand All @@ -17,7 +17,9 @@ allowlist_externals = pytest
setenv =
TOXINIDIR = {toxinidir}
passenv =
HOME HIC_TOKEN VMM_TOKEN
HOME
HIC_TOKEN
VMM_TOKEN
extras =
develop
commands =
Expand Down

0 comments on commit c843ff2

Please sign in to comment.