Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Release 0.7.12 #153

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
25 changes: 25 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: Breaking Changes 💥
labels:
- Semver-Major
- breaking-change
- title: Exciting New Features 🎉
labels:
- enhancement
- feature
- title: Bug Fix 🐛
labels:
- bug-fix
- title: Dependencies Update 📦
labels:
- dependencies
- title: Documentation 📝
labels:
- documentation
- title: Other Changes
labels:
- "*"
26 changes: 26 additions & 0 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
on:
push:
branches:
- master

name: Create Release

jobs:
create-github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Read version
id: read-version
run: |
version=$(<wapi/VERSION)
echo "VERSION=$version" >> "$GITHUB_OUTPUT"
echo "version is $version"
- name: Create Release
run: gh release create ${{ steps.read-version.outputs.VERSION }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56 changes: 56 additions & 0 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publish package

on:
push:
branches:
- master

workflow_dispatch:
inputs:
version:
description: "Version to publish"
required: false
default: ""

jobs:
publish-package:
timeout-minutes: 10
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: 3.11

- run: pip install -U twine wheel

- name: Read version
id: read-version
run: |

# override VERSION file with input from dispatch action
if [ ${{ github.event_name }} == "workflow_dispatch" ]; then
version_input=${{ github.event.inputs.version }}
echo $version_input > wapi/VERSION
fi

version=$(<wapi/VERSION)
echo "VERSION=$version" >> "$GITHUB_OUTPUT"
echo "version is $version"

- name: Build dist
id: build-dist
run: |

VERSION=${{ steps.read-version.outputs.VERSION }}
rm -rf dist
python setup.py sdist bdist_wheel

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

1 change: 0 additions & 1 deletion examples/Listening_for_changes/renewables_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import wapi
import pandas as pd
import matplotlib.pyplot as plt
import time
import os

Expand Down
2 changes: 1 addition & 1 deletion examples/general_examples/gen_pv_actuals_vs_forecast.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
This simple example compares yesterdays Photovoltaic Forecast based on the EC00
This simple example compares yesterday's Photovoltaic Forecast based on the EC00
weather forecast and the GFS00 weather forecasts with the Actual PV production.
The comparison can be performed for any region
"""
Expand Down
1 change: 0 additions & 1 deletion examples/general_examples/gen_save_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import wapi
import pandas as pd
import matplotlib.pyplot as plt
import os

############################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""

import wapi
import pandas as pd
import matplotlib.pyplot as plt

############################################
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ pytz
pandas >= 0.21
future >= 0.16
configparser >= 3.5; python_version < "3"
matplotlib
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

here = os.path.abspath(os.path.dirname(__file__))
# Get current version from the VERSION file
with open(os.path.join(here, 'VERSION')) as fv:
version = fv.read()
with open(os.path.join(here, 'wapi/VERSION')) as fv:
version = fv.read().strip()

install_requires = [
'requests >= 2.18',
Expand Down
1 change: 1 addition & 0 deletions wapi/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.7.12
6 changes: 4 additions & 2 deletions wapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#
# Wattsight API access library
#

import os
from .session import Session
from . import auth, curves, events, session, util

VERSION = __version__ = '0.7.11'
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'VERSION')) as fv:
VERSION = __version__ = fv.read().strip()
1 change: 0 additions & 1 deletion wapi/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Authentication support
#

import imp
import json
import time
import threading
Expand Down
4 changes: 2 additions & 2 deletions wapi/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def fetch_events(self):
if sse_event.retry is not None:
try:
self.retry = int(sse_event.retry)
except:
except Exception:
Dismissed Show dismissed Hide dismissed
pass
if self.do_shutdown:
break
Expand Down Expand Up @@ -107,7 +107,7 @@ def __init__(self, sse_event):
self._raw_event = sse_event
try:
self.json_data = json.loads(sse_event.data)
except:
except Exception:
self.json_data = None


Expand Down
Loading