Skip to content

Commit

Permalink
Merge pull request #204 from reportportal/develop
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
HardNorth authored Mar 28, 2023
2 parents f5cac72 + 1b74f8d commit 45b8002
Show file tree
Hide file tree
Showing 36 changed files with 690 additions and 1,450 deletions.
207 changes: 108 additions & 99 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
name: Upload Python Package
# Copyright 2022 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Release client

on:
push:
branches: ['master']
branches: [ 'master' ]
paths-ignore:
- '.github/**'
- CHANGELOG.md
- README.rst
- README.md
- CONTRIBUTING.rst

env:
Expand All @@ -22,99 +35,95 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Generate versions
uses: HardNorth/github-version-generate@v1.2.0
with:
version-source: file
version-file: ${{ env.VERSION_FILE }}
version-file-extraction-pattern: ${{ env.VERSION_EXTRACT_PATTERN }}

- name: Setup git credentials
uses: oleksiyrudenko/gha-git-credentials@v2
with:
name: 'reportportal.io'
email: 'support@reportportal.io'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Tagging new version
id: newVersionTag
run: |
git tag -a ${{ env.RELEASE_VERSION }} -m "Release ${{ env.RELEASE_VERSION }}"
git push --tags
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.6'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Checkout develop branch
uses: actions/checkout@v2
with:
ref: 'develop'
fetch-depth: 0

- name: Update CHANGELOG.md
id: changelogUpdate
run: |
sed '/\[Unreleased\]/q' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
sed -E '1,/#?#\s*\[Unreleased\]/d' ${{ env.CHANGE_LOG_FILE }} | sed -E '/#?#\s*\[/q' | \
{ echo -e '\n## [${{ env.RELEASE_VERSION }}]'; sed '$d'; } >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
grep -E '#?#\s*\[[0-9]' ${{ env.CHANGE_LOG_FILE }} | head -n1 >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
sed -E '1,/#?#\s*\[[0-9]/d' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
rm ${{ env.CHANGE_LOG_FILE }}
mv ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }} ${{ env.CHANGE_LOG_FILE }}
git add ${{ env.CHANGE_LOG_FILE }}
git commit -m "Changelog update"
- name: Read changelog Entry
id: readChangelogEntry
uses: mindsers/changelog-reader-action@v1.3.1
with:
version: ${{ env.RELEASE_VERSION }}
path: ./${{ env.CHANGE_LOG_FILE }}

- name: Create Release
id: createRelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
body: ${{ steps.readChangelogEntry.outputs.log_entry }}
draft: false
prerelease: false

- name: Merge release branch into develop
id: mergeIntoDevelop
run: |
git merge -m 'Merge master branch into develop after a release' origin/master
git status | (! grep -Fq 'both modified:') || git status | grep -F 'both modified:' \
| { echo -e 'Unable to merge master into develop, merge conflicts:'; (! grep -Eo '[^ ]+$') }
- name: Update version file
id: versionFileUpdate
run: |
export CURRENT_VERSION_VALUE=`echo '${{ env.CURRENT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
export NEXT_VERSION_VALUE=`echo '${{ env.NEXT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
sed "s/${CURRENT_VERSION_VALUE}/${NEXT_VERSION_VALUE}/g" ${{ env.VERSION_FILE }} > ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }}
rm ${{ env.VERSION_FILE }}
mv ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }} ${{ env.VERSION_FILE }}
git add ${{ env.VERSION_FILE }}
git commit -m "Version update"
git push
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel

- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PYPI_USERNAME }}
password: ${{ secrets.PYPI_PASSWORD }}

- name: Generate versions
uses: HardNorth/github-version-generate@v1
with:
version-source: file
version-file: ${{ env.VERSION_FILE }}
version-file-extraction-pattern: ${{ env.VERSION_EXTRACT_PATTERN }}

- name: Setup git credentials
uses: oleksiyrudenko/gha-git-credentials@v2.1.1
with:
name: 'reportportal.io'
email: 'support@reportportal.io'
token: ${{ secrets.GITHUB_TOKEN }}

- name: Tagging new version
id: newVersionTag
run: |
git tag -a ${{ env.RELEASE_VERSION }} -m "Release ${{ env.RELEASE_VERSION }}"
git push --tags
- name: Update CHANGELOG.md
id: changelogUpdate
run: |
sed '/\[Unreleased\]/q' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
sed -E '1,/#?#\s*\[Unreleased\]/d' ${{ env.CHANGE_LOG_FILE }} | sed -E '/#?#\s*\[/q' | \
{ echo -e '\n## [${{ env.RELEASE_VERSION }}]'; sed '$d'; } >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
grep -E '#?#\s*\[[0-9]' ${{ env.CHANGE_LOG_FILE }} | head -n1 >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
sed -E '1,/#?#\s*\[[0-9]/d' ${{ env.CHANGE_LOG_FILE }} >> ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }}
rm ${{ env.CHANGE_LOG_FILE }}
mv ${{ env.CHANGE_LOG_FILE }}${{ env.TMP_SUFFIX }} ${{ env.CHANGE_LOG_FILE }}
git add ${{ env.CHANGE_LOG_FILE }}
git commit -m "Changelog update"
- name: Read changelog Entry
id: readChangelogEntry
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ env.RELEASE_VERSION }}
path: ./${{ env.CHANGE_LOG_FILE }}

- name: Create Release
id: createRelease
uses: ncipollo/release-action@v1
with:
tag: ${{ env.RELEASE_VERSION }}
name: Release ${{ env.RELEASE_VERSION }}
body: ${{ steps.readChangelogEntry.outputs.changes }}

- name: Checkout develop branch
uses: actions/checkout@v3
with:
ref: 'develop'
fetch-depth: 0

- name: Merge release branch into develop
id: mergeIntoDevelop
run: |
git merge -m 'Merge master branch into develop after a release' origin/master
git status | (! grep -Fq 'both modified:') || git status | grep -F 'both modified:' \
| { echo -e 'Unable to merge master into develop, merge conflicts:'; (! grep -Eo '[^ ]+$') }
- name: Update version file
id: versionFileUpdate
run: |
export CURRENT_VERSION_VALUE=`echo '${{ env.CURRENT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
export NEXT_VERSION_VALUE=`echo '${{ env.NEXT_VERSION }}' | sed -E "s/(.*)/${{ env.VERSION_REPLACE_PATTERN }}/"`
sed "s/${CURRENT_VERSION_VALUE}/${NEXT_VERSION_VALUE}/g" ${{ env.VERSION_FILE }} > ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }}
rm ${{ env.VERSION_FILE }}
mv ${{ env.VERSION_FILE }}${{ env.TMP_SUFFIX }} ${{ env.VERSION_FILE }}
git add ${{ env.VERSION_FILE }}
git commit -m 'Version update'
git push
73 changes: 48 additions & 25 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,61 @@
# Copyright 2022 EPAM Systems
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Tests

on:
push:
branches:
- '*'
- '!master'
- '*'
- '!master'

paths-ignore:
- README.md
- README_TEMPLATE.md
- CHANGELOG.md

pull_request:
branches:
- 'master'
- 'develop'
- 'master'
- 'develop'

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
python-version: [ '2.7', '3.6', '3.7', '3.8', '3.9', '3.10' ]
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: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
- name: Upload coverage to Codecov
if: matrix.python-version == 3.6 && success()
uses: codecov/codecov-action@v1
with:
files: coverage.xml
flags: unittests
name: codecov-client-reportportal
path_to_write_report: codecov_report.txt
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox

- name: Upload coverage to Codecov
if: matrix.python-version == 3.6 && success()
uses: codecov/codecov-action@v3
with:
files: coverage.xml
flags: unittests
name: codecov-client-reportportal
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ target/
.python-version

# virtualenv
venv/
.venv/
venv*/
?venv*/

# pycharm
.idea/
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repos:
rev: v1.0.1
hooks:
- id: rst-linter
- repo: https://gitlab.com/pycqa/flake8.git
rev: 3.9.0
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@

## [Unreleased]
### Fixed
- Issue [#198](https://github.com/reportportal/client-Python/issues/198): Python 3.8+ logging issue, by @HardNorth
- Issue [#200](https://github.com/reportportal/client-Python/issues/200): max_pool_size not worked without retries setting, by @ericscobell
- Issue [#202](https://github.com/reportportal/client-Python/issues/202): TypeError on request make, by @HardNorth
### Changed
- Statistics service rewrite, by @HardNorth
### Removed
- Deprecated code, `service.py` and `LogManager` in `core` package, by @HardNorth

## [5.2.5]
### Fixed
- Issue [#194](https://github.com/reportportal/client-Python/issues/194): logging URL generation, by @HardNorth
- Issue [#195](https://github.com/reportportal/client-Python/issues/195): `None` mode exception
- Issue [#195](https://github.com/reportportal/client-Python/issues/195): `None` mode exception, by @HardNorth

## [5.2.4]
### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Python versions](https://img.shields.io/pypi/pyversions/reportportal-client.svg)](https://pypi.org/project/reportportal-client)
[![Build Status](https://github.com/reportportal/client-Python/actions/workflows/tests.yml/badge.svg)](https://github.com/reportportal/client-Python/actions/workflows/tests.yml)
[![codecov.io](https://codecov.io/gh/reportportal/client-Python/branch/master/graph/badge.svg)](https://codecov.io/gh/reportportal/client-Python)
[![Join Slack chat!](https://reportportal-slack-auto.herokuapp.com/badge.svg)](https://reportportal-slack-auto.herokuapp.com)
[![Join Slack chat!](https://slack.epmrpp.reportportal.io/badge.svg)](https://slack.epmrpp.reportportal.io/)
[![stackoverflow](https://img.shields.io/badge/reportportal-stackoverflow-orange.svg?style=flat)](http://stackoverflow.com/questions/tagged/reportportal)
[![Build with Love](https://img.shields.io/badge/build%20with-❤%EF%B8%8F%E2%80%8D-lightgrey.svg)](http://reportportal.io?style=flat)

Expand Down
4 changes: 2 additions & 2 deletions reportportal_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

from ._local import current
from .logs import RPLogger, RPLogHandler
from .service import ReportPortalService
from .client import RPClient
from .steps import step

__all__ = [
'current',
'RPLogger',
'RPLogHandler',
'ReportPortalService',
'RPClient',
'step',
]
Loading

0 comments on commit 45b8002

Please sign in to comment.