Skip to content

Commit

Permalink
Release 1.8.0 (#241)
Browse files Browse the repository at this point in the history
* Updated the CHANGES.md to include everything since 1.8.0 (including 1.7.1!)
* Removed more python 2 compat code
* Added a long description to all packages, which is required for PyPI
* Updated the version number to 1.8.0
* Fixed the build installing two separate Chrome versions
* Releases to PyPI and GitHub when the version number increments on master
  • Loading branch information
jonbannister authored Oct 17, 2024
1 parent 01b3fb2 commit 286e040
Show file tree
Hide file tree
Showing 19 changed files with 179 additions and 53 deletions.
124 changes: 111 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

test-tmpl: &test-tmpl
command: |
pwd
. ../venv/bin/activate
export DEBUG=1
export SERVER_FIXTURES_HOSTNAME=127.0.0.1
Expand All @@ -11,7 +12,7 @@ job-tmpl: &job-tmpl
machine:
image: ubuntu-2004:edge

working_directory: ~/src
working_directory: /home/circleci/src

steps:
- run: env
Expand Down Expand Up @@ -59,51 +60,51 @@ job-tmpl: &job-tmpl
make develop
- run:
name: Run Tests - pytest-fixture-config
working_directory: ~/src/pytest-fixture-config
working_directory: /home/circleci/src/pytest-fixture-config
<<: *test-tmpl
- run:
name: Run Tests - pytest-shutil
working_directory: ~/src/pytest-shutil
working_directory: /home/circleci/src/pytest-shutil
<<: *test-tmpl
- run:
name: Run Tests - pytest-server-fixtures
working_directory: ~/src/pytest-server-fixtures
working_directory: /home/circleci/src/pytest-server-fixtures
<<: *test-tmpl
- run:
name: Run Tests - pytest-pyramid-server
working_directory: ~/src/pytest-pyramid-server
working_directory: /home/circleci/src/pytest-pyramid-server
<<: *test-tmpl
- run:
name: Run Tests - pytest-devpi-server
working_directory: ~/src/pytest-devpi-server
working_directory: /home/circleci/src/pytest-devpi-server
<<: *test-tmpl
- run:
name: Run Tests - pytest-listener
working_directory: ~/src/pytest-listener
working_directory: /home/circleci/src/pytest-listener
<<: *test-tmpl
- run:
name: Run Tests - pytest-svn
working_directory: ~/src/pytest-svn
working_directory: /home/circleci/src/pytest-svn
<<: *test-tmpl
- run:
name: Run Tests - pytest-git
working_directory: ~/src/pytest-git
working_directory: /home/circleci/src/pytest-git
<<: *test-tmpl
- run:
name: Run Tests - pytest-virtualenv
working_directory: ~/src/pytest-virtualenv
working_directory: /home/circleci/src/pytest-virtualenv
<<: *test-tmpl
- run:
name: Run Tests - pytest-webdriver
working_directory: ~/src/pytest-webdriver
working_directory: /home/circleci/src/pytest-webdriver
<<: *test-tmpl
- run:
name: Run Tests - pytest-profiling
working_directory: ~/src/pytest-profiling
working_directory: /home/circleci/src/pytest-profiling
<<: *test-tmpl
- run:
name: Run Tests - pytest-verbose-parametrize
working_directory: ~/src/pytest-verbose-parametrize
working_directory: /home/circleci/src/pytest-verbose-parametrize
<<: *test-tmpl
- run:
name: Archive Junit and Coverage
Expand All @@ -121,6 +122,31 @@ job-tmpl: &job-tmpl
- run:
name: Explode if tests have failed
command: compgen -G FAILED-* && exit 1 || true
- run:
name: Build artifacts
command: |
. venv/bin/activate
make wheels
make sdists
mkdir dist
mv */dist/* dist
- run:
name: Move artifacts to workspace
command: |
mkdir -p /tmp/to-release/dist
if [ "$PYTHON" = "python3.6" ]; then
cp -r /home/circleci/src/dist /tmp/to-release/
cp /home/circleci/src/VERSION /tmp/to-release/VERSION
cp /home/circleci/src/CHANGES.md /tmp/to-release/CHANGES.md
fi
# Save artifacts. This is silly but wildcards aren't supported.
- store_artifacts:
path: /home/circleci/src/dist/
- persist_to_workspace:
root: /tmp/to-release/
paths:
- ./*
- ./dist/*

version: 2
jobs:
Expand All @@ -134,9 +160,81 @@ jobs:
environment:
PYTHON: "python3.7"

pypi-release:
docker:
- image: cimg/python:3.11.0
steps:
- attach_workspace:
at: /tmp/to-release
- run:
name: Upload to TestPyPI
command: | # install twine and publish to Test PyPI
cd /tmp/to-release
sudo add-apt-repository universe -y
sudo apt-get update
sudo apt install -y python3-pip
sudo pip install pipenv
pipenv install twine
pipenv run twine upload --skip-existing --verbose dist/*
publish-github-release:
docker:
- image: cibuilds/github:0.13
steps:
- attach_workspace:
at: /tmp/to-release
- run:
name: Output useful stuff
command: |
cd /tmp/to-release/
VERSION_FILE="/tmp/to-release/VERSION"
if [ ! -f "$VERSION_FILE" ]; then
echo "Error: Version file not found at $VERSION_FILE"
exit 1
fi
VERSION=$(cat "$VERSION_FILE" | tr -d '[:space:]')
if [ -z "$VERSION" ]; then
echo "Error: Version file is empty"
exit 1
fi
# Find the lines of the changelog between releases, escape double quotes, delete empty lines
awk '/### '"$VERSION"'/,/^$/{print}' CHANGES.md | sed '1d;$d' > latest_changes.md
- run:
name: "Publish release on GitHub"
command: |
VERSION=$(cat /tmp/to-release/VERSION)
CHANGES=$(cat /tmp/to-release/latest_changes.md)
ghr -t ${GITHUB_TOKEN} \
-u ${CIRCLE_PROJECT_USERNAME} \
-r ${CIRCLE_PROJECT_REPONAME} \
-c ${CIRCLE_SHA1} \
-n ${VERSION} \
-b "${CHANGES}" \
-soft \
${VERSION} /tmp/to-release/dist
workflows:
version: 2
pytest-plugins:
jobs:
- py36
- py37
- pypi-release:
requires:
- py36
- py37
filters:
branches:
only:
- master
- publish-github-release:
requires:
- py36
- py37
filters:
branches:
only:
- master

40 changes: 35 additions & 5 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@

## Changelog
### 1.8.0
* pytest-server-fixtures: Removed RethinkDB support.

### 1.7.0
### 1.8.0 (2024-10-??)
* All: Drop support for Python 2 and <3.6, removing compatibility code.
* All: Use stdlib unittest.mock instead of mock package.
* All: Removed usage of path.py and path in favour of pathlib. #174 #224
* pytest-devpi-server: Run devpi-init for initialisation. #179
* pytest-server-fixtures: BREAKING CHANGE: Removed RethinkDB support, as the project is no longer maintained.
* pytest-server-fixtures: Allowed passing through HTTP headers to the server. #149
* pytest-server-fixtures: Fixed threading log debug messages. #146
* pytest-server-fixtures: Removed usage of deprecated Thread.setDaemon. #202
* pytest-server-fixtures: Explicitly close initial Mongo client. #198
* pytest-server-fixtures: Don't use context manager for CREATE DATABASE #186
* pytest-shutil: Removed contextlib2 requirement. #144
* pytest-shutil: Fixed forcing color through termcolor. #217
* pytest-shutil: Replaced deprecated imp module #219
* pytest-profiling: Added support to hide/show the full path of file. #95
* pytest-profiling: Fixed SVG file generation on Windows. #93
* pytest-profiling: Remove pinning of more-itertools. #194
* pytest-profiling: Add support to define element number for print_stats() #96
* pytest-profiling: Fix mock in test_writes_summary #223
* pytest-virtualenv: Modernised package. #188 #185 #182 #163
* pytest-virtualenv: Fixed virtualenv creation on Windows. #142
* pytest-virtualenv: Added delete_workspace parameter to VirtualEnv. #195
* pytest-virtualenv: Removed extras_require. #240
* ci: Remove usage of deprecated distutils. #189
* ci: Disabled jenkins server tests on CircleCI to improve build time.
* ci: Fixed `collections` import for py 3.11 compatibility #222


### 1.7.1 (2019-05-28)
* pytest-profiling: Fix pytest-profiling to profile fixtures. #48
* pytest-devpi-server: Fixed Python 3.4 support updating "ruamel.yaml" requirements. #138
* ci: Added PYTEST_DONT_REWRITE in order to suppress module already imported. #123


### 1.7.0 (2019-02-21)
* All: Support pytest >= 4.0.0
* All: Support Python 3.7
* pytest-server-fixtures: if host not defined on your machine, default to localhost
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.7.1
1.8.0
31 changes: 13 additions & 18 deletions common_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,8 @@ def common_setup(src_dir):
readme_file = os.path.join(this_dir, 'README.md')
changelog_file = os.path.join(this_dir, 'CHANGES.md')
version_file = os.path.join(this_dir, 'VERSION')

# Convert Markdown to RST for PyPI
try:
import pypandoc
long_description = pypandoc.convert_file(readme_file, 'rst')
changelog = pypandoc.convert_file(changelog_file, 'rst')
except (IOError, ImportError, OSError):
long_description = open(readme_file).read()
changelog = open(changelog_file).read()
long_description = open(readme_file).read()
changelog = open(changelog_file).read()

# Gather trailing arguments for pytest, this can't be done using setuptools' api
if 'test' in sys.argv:
Expand All @@ -66,12 +59,14 @@ def common_setup(src_dir):
PyTest.src_dir = src_dir

return dict(
# Version is shared between all the projects in this repo
version=open(version_file).read().strip(),
long_description='\n'.join((long_description, changelog)),
url='https://github.com/manahl/pytest-plugins',
license='MIT license',
platforms=['unix', 'linux'],
cmdclass={'test': PyTest, 'egg_info': EggInfo},
include_package_data=True
)
# Version is shared between all the projects in this repo
version=open(version_file).read().strip(),
long_description='\n'.join((long_description, changelog)),
long_description_content_type='text/markdown',
url='https://github.com/man-group/pytest-plugins',
license='MIT license',
platforms=['unix', 'linux'],
cmdclass={'test': PyTest, 'egg_info': EggInfo},
include_package_data=True,
python_requires='>=3.6',
)
7 changes: 5 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function update_apt_sources {
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \
--dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

apt install ca-certificates
apt-get update
Expand Down Expand Up @@ -165,7 +165,10 @@ function install_minio {
function install_chrome_headless {
wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/google-chrome-stable_current_amd64.deb
dpkg -i --force-depends /tmp/google-chrome-stable_current_amd64.deb || apt-get install -f -y
wget -q https://storage.googleapis.com/chrome-for-testing-public/128.0.6613.86/linux64/chromedriver-linux64.zip -O /tmp/chromedriver_linux64.zip
json=$(curl -s https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json)
version=$(echo "$json" | jq -r '.channels.Stable.version')
url="https://storage.googleapis.com/chrome-for-testing-public/$version/linux64/chromedriver-linux64.zip"
wget -q "$url" -O /tmp/chromedriver_linux64.zip
unzip /tmp/chromedriver_linux64.zip
mv chromedriver-linux64/chromedriver /usr/local/bin/
chmod a+x /usr/local/bin/chromedriver
Expand Down
2 changes: 1 addition & 1 deletion pytest-devpi-server/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-fixture-config/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-git/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-listener/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-profiling/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ norecursedirs =
tests/integration/profile/tests

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-pyramid-server/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-qt-app/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-server-fixtures/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-server-fixtures/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
kwargs = common_setup('pytest_server_fixtures')
kwargs.update(dict(
name='pytest-server-fixtures',
description='Extensible server fixures for py.test',
description='Extensible server fixtures for py.test',
author='Edward Easton',
author_email='[email protected]',
classifiers=classifiers,
Expand Down
2 changes: 1 addition & 1 deletion pytest-shutil/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-svn/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-verbose-parametrize/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ norecursedirs =
tests/integration/parametrize_ids

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-virtualenv/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0
2 changes: 1 addition & 1 deletion pytest-webdriver/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ norecursedirs =
dist

[bdist_wheel]
universal = 1
universal = 0

0 comments on commit 286e040

Please sign in to comment.