Skip to content

Commit

Permalink
Release 0.9.5 (#6)
Browse files Browse the repository at this point in the history
* Release 0.9.5
  • Loading branch information
Hirotaka Wakabayashi authored Dec 1, 2020
1 parent fc45891 commit 6775cc1
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 79 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]') && ! contains(toJSON(github.event.commits.*.message), '[ci skip]')"
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: |
make init
- name: Lint with flake8, mypy, pylint and checkdocs
run: |
# stop the build if there are Python syntax errors or undefined names
make lint
- name: Run tests
run: |
make test
- name: Check coverage
run: |
make coverage
- name: Make docs
run: |
make docs
- name: Make dist package
run: |
make dist
- name: Install the package locally
run: |
make install
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

10 changes: 10 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
History
=======

0.9.5 (2020-12-01)
-------------------

* Removes the --user option from pip command

0.9.4 (2020-12-01)
-------------------

* Changes CI from Travis to GitHub Actions

0.9.3 (2020-11-30)
-------------------

Expand Down
80 changes: 50 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,29 @@ BROWSER := python3 -c "$$BROWSER_PYSCRIPT"
help:
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

# Initialize development environment
# Initialization fails if dependency problems happens or security vulnerabilities are detected.
#
# Note:
# Make sure python3-devel or python3-dev is installed. Because oslo-message(or dependent libs) requires Python.h
init:
python3 -m pip install pipenv
pipenv install --skip-lock
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade pipenv
pipenv install --dev --skip-lock
pipenv graph
pipenv install --dev
pipenv check

# Lint code and docs
# lint fails if there are syntax errors or undefined names.
#
# Note:
# lint commands should be emit in virtualenv activated environment.
lint:
pipenv run flake8 --version
pipenv run flake8 k2hr3_osnl tests
pipenv run mypy k2hr3_osnl tests
pipenv run pylint k2hr3_osnl tests --py3k -r n
pipenv run python3 setup.py checkdocs

clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

Expand All @@ -76,74 +94,76 @@ clean-test: ## remove test and coverage artifacts
rm -fr htmlcov/
rm -fr .pytest_cache

lint: ## check style with flake8
flake8 --version
flake8 k2hr3_osnl tests
mypy k2hr3_osnl tests
pylint k2hr3_osnl tests --py3k -r n
python3 -m pip install collective.checkdocs
python3 setup.py checkdocs

test: ## run tests quickly with the default Python
python3 -m unittest
test-only: ## run tests quickly with the default Python
pipenv run python3 -m unittest

# Check version strings consistency
# Make sure the following version strings are same.
# 1. HISTORY.rst
# 2. python-k2hr3-osnl.spec
# 3. __init__.py
version:
@rm -f VERSION RPMSPEC_VERSION
@perl -ne 'print if /^[0-9]+.[0-9]+.[0-9]+ \([0-9]{4}-[0-9]{2}-[0-9]{2}\)$$/' HISTORY.rst \
| head -n 1 | perl -lne 'print $$1 if /^([0-9]+.[0-9]+.[0-9]+) \(.*\)/' > VERSION
@perl -ne 'print $$2 if /^Version:(\s+)([0-9]+.[0-9]+.[0-9]+)$$/' python-k2hr3-osnl.spec > RPMSPEC_VERSION

SOURCE_VERSION = $(shell python3 -c 'import k2hr3_osnl; print(k2hr3_osnl.version())')
SOURCE_VERSION = $(shell pipenv run python3 -c 'import k2hr3_osnl; print(k2hr3_osnl.version())')
HISTORY_VERSION = $(shell cat VERSION)
RPMSPEC_VERSION = $(shell cat RPMSPEC_VERSION)

test-with-version: version ## builds source and wheel package
# Check version strings consistency
# Make sure the following version strings are same.
# 1. HISTORY.rst
# 2. python-k2hr3-osnl.spec
# 3. __init__.py
test: version ## builds source and wheel package
@echo 'source ' ${SOURCE_VERSION}
@echo 'history ' ${HISTORY_VERSION}
@echo 'rpmspec ' ${RPMSPEC_VERSION}
@if test "${SOURCE_VERSION}" = "${HISTORY_VERSION}" -a "${HISTORY_VERSION}" = "${RPMSPEC_VERSION}" ; then \
python3 -m unittest ; \
pipenv run python3 -m unittest ; \
fi

test-all: lint test-version
test-all: lint test

coverage: ## check code coverage quickly with the default Python
coverage run --source k2hr3_osnl -m unittest
coverage report -m
coverage xml
coverage html
pipenv run coverage run --source k2hr3_osnl -m unittest
pipenv run coverage report -m
pipenv run coverage xml
pipenv run coverage html
# $(BROWSER) htmlcov/index.html

docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/k2hr3_osnl.rst
rm -f docs/modules.rst
sphinx-apidoc -o docs/ k2hr3_osnl
pipenv run sphinx-apidoc -o docs/ k2hr3_osnl
$(MAKE) -C docs clean
$(MAKE) -C docs html
# $(BROWSER) docs/_build/html/index.html

servedocs: docs ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
pipenv run watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .

release: dist ## package and upload a release
twine check dist/*
twine upload dist/*
pipenv run twine check dist/*
pipenv run twine upload dist/*

test-release:
twine check dist/*
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
pipenv run twine check dist/*
pipenv run twine upload --repository-url https://test.pypi.org/legacy/ dist/*

dist: clean version ## builds source and wheel package
@echo 'source ' ${SOURCE_VERSION}
@echo 'history ' ${HISTORY_VERSION}
@if test "${SOURCE_VERSION}" = "${HISTORY_VERSION}" -a "${HISTORY_VERSION}" = "${RPMSPEC_VERSION}" ; then \
python3 setup.py sdist ; \
python3 setup.py bdist_wheel ; \
pipenv run python3 setup.py sdist ; \
pipenv run python3 setup.py bdist_wheel ; \
ls -l dist ; \
fi

install: clean ## install the package to the active Python's site-packages
python3 setup.py install
pipenv run python3 setup.py install

#
# VIM modelines
Expand Down
3 changes: 3 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ astroid = {version = ">=2.4.2,<2.4.3"}
typed-ast = {version = ">=1.4.1,<1.4.2"}
mypy = {version = ">=0.790,<0.791"}
importlib-metadata = {version = ">=2.1.0,<2.2.0"}
"collective.checkdocs" = "*"
argh = {version = ">=0.26.2,<0.26.3"}
watchdog = {version = ">=0.10.4,<0.10.5"}

[packages]
oslo-config = "*"
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python3 -msphinx
SPHINXBUILD = pipenv run python3 -msphinx
SPHINXPROJ = k2hr3_osnl
SOURCEDIR = .
BUILDDIR = _build
Expand Down
2 changes: 1 addition & 1 deletion k2hr3_osnl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'version',
]
__author__ = 'Hirotaka Wakabayashi <[email protected]>'
__version__ = '0.9.3'
__version__ = '0.9.5'

import argparse
import logging
Expand Down
8 changes: 7 additions & 1 deletion python-k2hr3-osnl.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%global srcname k2hr3_osnl
%global pypi_name k2hr3-osnl
Name: python-k2hr3-osnl
Version: 0.9.3
Version: 0.9.4
Release: 1%{?dist}
Summary: An OpenStack notification listener for K2HR3

Expand Down Expand Up @@ -83,6 +83,12 @@ rm -rf %{buildroot}/usr/etc/k2hr3/k2hr3-osnl.conf
%{_mandir}/man1/k2hr3-osnl.1*

%changelog
* Tue Dec 01 2020 Hirotaka Wakabayashi <[email protected]> 0.9.5-1
- Update for Release Version 0.9.5

* Tue Dec 01 2020 Hirotaka Wakabayashi <[email protected]> 0.9.4-1
- Update for Release Version 0.9.4

* Mon Nov 30 2020 Hirotaka Wakabayashi <[email protected]> 0.9.3-1
- Update for Release Version 0.9.3

Expand Down

0 comments on commit 6775cc1

Please sign in to comment.