Skip to content

Commit

Permalink
Merge pull request #7 from pycompression/release_0.1.0
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
rhpvorderman authored Jan 31, 2023
2 parents cceff09 + a84d332 commit d870bef
Show file tree
Hide file tree
Showing 40 changed files with 6,601 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

### Checklist
- [ ] Pull request details were added to CHANGELOG.rst
- [ ] Documentation was updated (if needed)
17 changes: 17 additions & 0 deletions .github/release_checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Release checklist
- [ ] Check outstanding issues on JIRA and Github.
- [ ] Check [latest documentation](https://python-zlib-ng.readthedocs.io/en/latest/) looks fine.
- [ ] Create a release branch.
- [ ] Set version to a stable number.
- [ ] Change current development version in `CHANGELOG.rst` to stable version.
- [ ] Change the version in `__init__.py`
- [ ] Merge the release branch into `main`.
- [ ] Created an annotated tag with the stable version number. Include changes
from CHANGELOG.rst.
- [ ] Push tag to remote. This triggers the wheel/sdist build on github CI.
- [ ] merge `main` branch back into `develop`.
- [ ] Add updated version number to develop. (`setup.py` and `src/zlib_ng/__init__.py`)
- [ ] Build the new tag on readthedocs. Only build the last patch version of
each minor version. So `1.1.1` and `1.2.0` but not `1.1.0`, `1.1.1` and `1.2.0`.
- [ ] Create a new release on github.
- [ ] Update the package on conda-forge.
238 changes: 238 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
name: Continous integration

on:
pull_request:
paths-ignore:
- 'docs/**'
- '*.rst'
push:
branches:
- develop
- main
tags:
- "*"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: recursive
- name: Set up Python 3.7
uses: actions/setup-python@v2.2.1
with:
python-version: 3.7
- name: Install tox
run: pip install tox
- name: Lint
run: tox -e lint

package-checks:
strategy:
matrix:
tox_env:
- docs
- twine_check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: recursive
- name: Set up Python 3.7
uses: actions/setup-python@v2.2.1
with:
python-version: 3.7
- name: Install tox and upgrade setuptools and pip
run: pip install --upgrade tox setuptools pip
- name: Run tox -e ${{ matrix.tox_env }}
run: tox -e ${{ matrix.tox_env }}

test-static:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "pypy-3.7"
- "pypy-3.8"
- "pypy-3.9"
os: ["ubuntu-latest"]
include:
- os: "macos-latest"
python-version: 3.7
- os: "windows-latest"
python-version: 3.7
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.1
with:
python-version: ${{ matrix.python-version }}
- name: Install tox and upgrade setuptools
run: pip install --upgrade tox setuptools
- name: Set MSVC developer prompt
uses: ilammy/msvc-dev-cmd@v1.6.0
if: runner.os == 'Windows'
- name: Install build dependencies (MacOS)
run: brew install make
if: runner.os == 'macOS'
- name: Run tests
run: tox
- name: Upload coverage report
uses: codecov/codecov-action@v1

test-arch:
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
runs-on: "ubuntu-latest"
strategy:
matrix:
distro: [ "ubuntu_latest" ]
arch: ["aarch64"]
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: recursive
- uses: uraimo/run-on-arch-action@v2.2.0
name: Build & run test
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
install: |
apt-get update -q -y
apt-get install -q -y python3 python3-pip tox cmake
run: |
tox
# Test if the python-zlib-ng conda package can be build. Which is linked
# dynamically to the conda zlib-ng package.
test-dynamic:
runs-on: ${{ matrix.os }}
defaults:
run:
# This is needed for miniconda, see:
# https://github.com/marketplace/actions/setup-miniconda#important.
shell: bash -l {0}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python_version: [ "python" ]
include:
- os: "ubuntu-latest"
python_version: "pypy"
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: recursive
- name: Install miniconda.
uses: conda-incubator/setup-miniconda@v2.0.1 # https://github.com/conda-incubator/setup-miniconda.
with:
channels: conda-forge,defaults
- name: Install requirements (universal)
run: conda install zlib-ng ${{ matrix.python_version}} tox
- name: Set MSVC developer prompt
uses: ilammy/msvc-dev-cmd@v1.6.0
if: runner.os == 'Windows'
- name: Run tests (dynamic link)
run: tox
env:
PYTHON_ZLIB_NG_LINK_DYNAMIC: True

deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
needs:
- lint
- package-checks
- test-static
- test-dynamic
- test-arch
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
cibw_archs_linux: ["x86_64"]
build_sdist: [true]
include:
- os: "ubuntu-latest"
cibw_archs_linux: "aarch64"
steps:
- uses: actions/checkout@v2.3.4
with:
submodules: recursive
- uses: actions/setup-python@v2
name: Install Python
- name: Install cibuildwheel twine build
run: python -m pip install cibuildwheel twine build
- name: Install build dependencies (Macos)
run: brew install make
if: runner.os == 'macOS'
- name: Set MSVC developer prompt
uses: ilammy/msvc-dev-cmd@v1.6.0
if: runner.os == 'Windows'
- name: Set up QEMU
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'aarch64'}}
uses: docker/setup-qemu-action@v1.0.1
with:
platforms: arm64
- name: Build wheels
run: cibuildwheel --output-dir dist
env:
CIBW_SKIP: "*-win32 *-manylinux_i686" # Skip 32 bit
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
CIBW_TEST_REQUIRES: "pytest"
# Simple tests that requires the project to be build correctly
CIBW_TEST_COMMAND_LINUX: >-
pytest {project}/tests/test_zlib_compliance.py
{project}/tests/test_gzip_compliance.py
{project}/tests/test_gzip_ng.py
CIBW_TEST_COMMAND_MACOS: >-
pytest {project}/tests/test_zlib_compliance.py
{project}/tests/test_gzip_compliance.py
{project}/tests/test_gzip_ng.py
# Windows does not have the test module in the included python.
# Run compatibility tests instead.
CIBW_TEST_COMMAND_WINDOWS: >-
pytest {project}/tests/test_compat.py
{project}/tests/test_gzip_ng.py
CIBW_ENVIRONMENT_LINUX: >-
PYTHON_ZLIB_NG_BUILD_CACHE=True
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=/tmp/build_cache
CFLAGS="-g0 -DNDEBUG"
CIBW_ENVIRONMENT_WINDOWS: >-
PYTHON_ZLIB_NG_BUILD_CACHE=True
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}\build_cache
CIBW_ENVIRONMENT_MACOS: >-
PYTHON_ZLIB_NG_BUILD_CACHE=True
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}/build_cache
CFLAGS="-g0 -DNDEBUG"
- name: Build sdist
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}}
run:
python -m build --sdist
- uses: actions/upload-artifact@v2
with:
name: "dist"
path: "dist/"
- name: Publish package to TestPyPI
# pypa/gh-action-pypi-publish@master does not work on OSX
# Alpha, Beta and dev releases contain a - in the tag.
if: contains(github.ref, '-') && startsWith(github.ref, 'refs/tags')
run: twine upload --skip-existing -r testpypi dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
- name: Publish package to PyPI
if: "!contains(github.ref, '-') && startsWith(github.ref, 'refs/tags')"
run: twine upload --skip-existing dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/zlib-ng"]
path = src/zlib_ng/zlib-ng
url = https://github.com/zlib-ng/zlib-ng.git
9 changes: 9 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
formats: [] # Do not build epub and pdf

python:
install:
- method: pip
path: .
conda:
environment: docs/conda-environment.yml
16 changes: 16 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
==========
Changelog
==========

.. Newest changes should be on top.
.. This document is user facing. Please word the changes in such a way
.. that users understand how the changes affect the new version.
version 0.1.0
-----------------
+ Build wheels for all three major operating systems.
+ Add a fully featured gzip application in python m zlib_ng.gzip_ng.
+ Port Cpython's gzip module to use zlib-ng.
+ Port CPython's zlib module to use zlib-ng.
+ Use zlib-ng version 2.0.6 as included statically linked version.
48 changes: 48 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------

1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.

2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.

3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.

4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.

5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.

6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.

7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.

8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graft src/zlib_ng/zlib-ng
Loading

0 comments on commit d870bef

Please sign in to comment.