Skip to content

Commit d870bef

Browse files
authored
Merge pull request #7 from pycompression/release_0.1.0
Release 0.1.0
2 parents cceff09 + a84d332 commit d870bef

40 files changed

+6601
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
### Checklist
3+
- [ ] Pull request details were added to CHANGELOG.rst
4+
- [ ] Documentation was updated (if needed)

.github/release_checklist.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Release checklist
2+
- [ ] Check outstanding issues on JIRA and Github.
3+
- [ ] Check [latest documentation](https://python-zlib-ng.readthedocs.io/en/latest/) looks fine.
4+
- [ ] Create a release branch.
5+
- [ ] Set version to a stable number.
6+
- [ ] Change current development version in `CHANGELOG.rst` to stable version.
7+
- [ ] Change the version in `__init__.py`
8+
- [ ] Merge the release branch into `main`.
9+
- [ ] Created an annotated tag with the stable version number. Include changes
10+
from CHANGELOG.rst.
11+
- [ ] Push tag to remote. This triggers the wheel/sdist build on github CI.
12+
- [ ] merge `main` branch back into `develop`.
13+
- [ ] Add updated version number to develop. (`setup.py` and `src/zlib_ng/__init__.py`)
14+
- [ ] Build the new tag on readthedocs. Only build the last patch version of
15+
each minor version. So `1.1.1` and `1.2.0` but not `1.1.0`, `1.1.1` and `1.2.0`.
16+
- [ ] Create a new release on github.
17+
- [ ] Update the package on conda-forge.

.github/workflows/ci.yml

+238
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
name: Continous integration
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '*.rst'
8+
push:
9+
branches:
10+
- develop
11+
- main
12+
tags:
13+
- "*"
14+
15+
jobs:
16+
lint:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/[email protected]
20+
with:
21+
submodules: recursive
22+
- name: Set up Python 3.7
23+
uses: actions/[email protected]
24+
with:
25+
python-version: 3.7
26+
- name: Install tox
27+
run: pip install tox
28+
- name: Lint
29+
run: tox -e lint
30+
31+
package-checks:
32+
strategy:
33+
matrix:
34+
tox_env:
35+
- docs
36+
- twine_check
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/[email protected]
40+
with:
41+
submodules: recursive
42+
- name: Set up Python 3.7
43+
uses: actions/[email protected]
44+
with:
45+
python-version: 3.7
46+
- name: Install tox and upgrade setuptools and pip
47+
run: pip install --upgrade tox setuptools pip
48+
- name: Run tox -e ${{ matrix.tox_env }}
49+
run: tox -e ${{ matrix.tox_env }}
50+
51+
test-static:
52+
runs-on: ${{ matrix.os }}
53+
strategy:
54+
matrix:
55+
python-version:
56+
- "3.7"
57+
- "3.8"
58+
- "3.9"
59+
- "3.10"
60+
- "3.11"
61+
- "pypy-3.7"
62+
- "pypy-3.8"
63+
- "pypy-3.9"
64+
os: ["ubuntu-latest"]
65+
include:
66+
- os: "macos-latest"
67+
python-version: 3.7
68+
- os: "windows-latest"
69+
python-version: 3.7
70+
steps:
71+
- uses: actions/[email protected]
72+
with:
73+
submodules: recursive
74+
- name: Set up Python ${{ matrix.python-version }}
75+
uses: actions/[email protected]
76+
with:
77+
python-version: ${{ matrix.python-version }}
78+
- name: Install tox and upgrade setuptools
79+
run: pip install --upgrade tox setuptools
80+
- name: Set MSVC developer prompt
81+
uses: ilammy/[email protected]
82+
if: runner.os == 'Windows'
83+
- name: Install build dependencies (MacOS)
84+
run: brew install make
85+
if: runner.os == 'macOS'
86+
- name: Run tests
87+
run: tox
88+
- name: Upload coverage report
89+
uses: codecov/codecov-action@v1
90+
91+
test-arch:
92+
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
93+
runs-on: "ubuntu-latest"
94+
strategy:
95+
matrix:
96+
distro: [ "ubuntu_latest" ]
97+
arch: ["aarch64"]
98+
steps:
99+
- uses: actions/[email protected]
100+
with:
101+
submodules: recursive
102+
- uses: uraimo/[email protected]
103+
name: Build & run test
104+
with:
105+
arch: ${{ matrix.arch }}
106+
distro: ${{ matrix.distro }}
107+
install: |
108+
apt-get update -q -y
109+
apt-get install -q -y python3 python3-pip tox cmake
110+
run: |
111+
tox
112+
113+
# Test if the python-zlib-ng conda package can be build. Which is linked
114+
# dynamically to the conda zlib-ng package.
115+
test-dynamic:
116+
runs-on: ${{ matrix.os }}
117+
defaults:
118+
run:
119+
# This is needed for miniconda, see:
120+
# https://github.com/marketplace/actions/setup-miniconda#important.
121+
shell: bash -l {0}
122+
strategy:
123+
matrix:
124+
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
125+
python_version: [ "python" ]
126+
include:
127+
- os: "ubuntu-latest"
128+
python_version: "pypy"
129+
steps:
130+
- uses: actions/[email protected]
131+
with:
132+
submodules: recursive
133+
- name: Install miniconda.
134+
uses: conda-incubator/[email protected] # https://github.com/conda-incubator/setup-miniconda.
135+
with:
136+
channels: conda-forge,defaults
137+
- name: Install requirements (universal)
138+
run: conda install zlib-ng ${{ matrix.python_version}} tox
139+
- name: Set MSVC developer prompt
140+
uses: ilammy/[email protected]
141+
if: runner.os == 'Windows'
142+
- name: Run tests (dynamic link)
143+
run: tox
144+
env:
145+
PYTHON_ZLIB_NG_LINK_DYNAMIC: True
146+
147+
deploy:
148+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
149+
runs-on: ${{ matrix.os }}
150+
needs:
151+
- lint
152+
- package-checks
153+
- test-static
154+
- test-dynamic
155+
- test-arch
156+
strategy:
157+
matrix:
158+
os:
159+
- ubuntu-latest
160+
- macos-latest
161+
- windows-latest
162+
cibw_archs_linux: ["x86_64"]
163+
build_sdist: [true]
164+
include:
165+
- os: "ubuntu-latest"
166+
cibw_archs_linux: "aarch64"
167+
steps:
168+
- uses: actions/[email protected]
169+
with:
170+
submodules: recursive
171+
- uses: actions/setup-python@v2
172+
name: Install Python
173+
- name: Install cibuildwheel twine build
174+
run: python -m pip install cibuildwheel twine build
175+
- name: Install build dependencies (Macos)
176+
run: brew install make
177+
if: runner.os == 'macOS'
178+
- name: Set MSVC developer prompt
179+
uses: ilammy/[email protected]
180+
if: runner.os == 'Windows'
181+
- name: Set up QEMU
182+
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'aarch64'}}
183+
uses: docker/[email protected]
184+
with:
185+
platforms: arm64
186+
- name: Build wheels
187+
run: cibuildwheel --output-dir dist
188+
env:
189+
CIBW_SKIP: "*-win32 *-manylinux_i686" # Skip 32 bit
190+
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
191+
CIBW_TEST_REQUIRES: "pytest"
192+
# Simple tests that requires the project to be build correctly
193+
CIBW_TEST_COMMAND_LINUX: >-
194+
pytest {project}/tests/test_zlib_compliance.py
195+
{project}/tests/test_gzip_compliance.py
196+
{project}/tests/test_gzip_ng.py
197+
CIBW_TEST_COMMAND_MACOS: >-
198+
pytest {project}/tests/test_zlib_compliance.py
199+
{project}/tests/test_gzip_compliance.py
200+
{project}/tests/test_gzip_ng.py
201+
# Windows does not have the test module in the included python.
202+
# Run compatibility tests instead.
203+
CIBW_TEST_COMMAND_WINDOWS: >-
204+
pytest {project}/tests/test_compat.py
205+
{project}/tests/test_gzip_ng.py
206+
CIBW_ENVIRONMENT_LINUX: >-
207+
PYTHON_ZLIB_NG_BUILD_CACHE=True
208+
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=/tmp/build_cache
209+
CFLAGS="-g0 -DNDEBUG"
210+
CIBW_ENVIRONMENT_WINDOWS: >-
211+
PYTHON_ZLIB_NG_BUILD_CACHE=True
212+
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}\build_cache
213+
CIBW_ENVIRONMENT_MACOS: >-
214+
PYTHON_ZLIB_NG_BUILD_CACHE=True
215+
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}/build_cache
216+
CFLAGS="-g0 -DNDEBUG"
217+
- name: Build sdist
218+
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}}
219+
run:
220+
python -m build --sdist
221+
- uses: actions/upload-artifact@v2
222+
with:
223+
name: "dist"
224+
path: "dist/"
225+
- name: Publish package to TestPyPI
226+
# pypa/gh-action-pypi-publish@master does not work on OSX
227+
# Alpha, Beta and dev releases contain a - in the tag.
228+
if: contains(github.ref, '-') && startsWith(github.ref, 'refs/tags')
229+
run: twine upload --skip-existing -r testpypi dist/*
230+
env:
231+
TWINE_USERNAME: __token__
232+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
233+
- name: Publish package to PyPI
234+
if: "!contains(github.ref, '-') && startsWith(github.ref, 'refs/tags')"
235+
run: twine upload --skip-existing dist/*
236+
env:
237+
TWINE_USERNAME: __token__
238+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "src/zlib-ng"]
2+
path = src/zlib_ng/zlib-ng
3+
url = https://github.com/zlib-ng/zlib-ng.git

.readthedocs.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
formats: [] # Do not build epub and pdf
3+
4+
python:
5+
install:
6+
- method: pip
7+
path: .
8+
conda:
9+
environment: docs/conda-environment.yml

CHANGELOG.rst

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
==========
2+
Changelog
3+
==========
4+
5+
.. Newest changes should be on top.
6+
7+
.. This document is user facing. Please word the changes in such a way
8+
.. that users understand how the changes affect the new version.
9+
10+
version 0.1.0
11+
-----------------
12+
+ Build wheels for all three major operating systems.
13+
+ Add a fully featured gzip application in python m zlib_ng.gzip_ng.
14+
+ Port Cpython's gzip module to use zlib-ng.
15+
+ Port CPython's zlib module to use zlib-ng.
16+
+ Use zlib-ng version 2.0.6 as included statically linked version.

LICENSE

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
2+
--------------------------------------------
3+
4+
1. This LICENSE AGREEMENT is between the Python Software Foundation
5+
("PSF"), and the Individual or Organization ("Licensee") accessing and
6+
otherwise using this software ("Python") in source or binary form and
7+
its associated documentation.
8+
9+
2. Subject to the terms and conditions of this License Agreement, PSF hereby
10+
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
11+
analyze, test, perform and/or display publicly, prepare derivative works,
12+
distribute, and otherwise use Python alone or in any derivative version,
13+
provided, however, that PSF's License Agreement and PSF's notice of copyright,
14+
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
15+
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
16+
All Rights Reserved" are retained in Python alone or in any derivative version
17+
prepared by Licensee.
18+
19+
3. In the event Licensee prepares a derivative work that is based on
20+
or incorporates Python or any part thereof, and wants to make
21+
the derivative work available to others as provided herein, then
22+
Licensee hereby agrees to include in any such work a brief summary of
23+
the changes made to Python.
24+
25+
4. PSF is making Python available to Licensee on an "AS IS"
26+
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
27+
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
28+
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
29+
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
30+
INFRINGE ANY THIRD PARTY RIGHTS.
31+
32+
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
33+
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
34+
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
35+
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
36+
37+
6. This License Agreement will automatically terminate upon a material
38+
breach of its terms and conditions.
39+
40+
7. Nothing in this License Agreement shall be deemed to create any
41+
relationship of agency, partnership, or joint venture between PSF and
42+
Licensee. This License Agreement does not grant permission to use PSF
43+
trademarks or trade name in a trademark sense to endorse or promote
44+
products or services of Licensee, or any third party.
45+
46+
8. By copying, installing or otherwise using Python, Licensee
47+
agrees to be bound by the terms and conditions of this License
48+
Agreement.

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
graft src/zlib_ng/zlib-ng

0 commit comments

Comments
 (0)