Loading .gitlab-ci.yml +13 −15 Original line number Diff line number Diff line Loading @@ -7,32 +7,30 @@ stages: before_script: - apt-get update -qq && apt-get install -y -q ghostscript - curl -O https://bootstrap.pypa.io/get-pip.py - python get-pip.py - pip install -r requirements.txt python2: image: python:2.7 python36: image: python:3.6 stage: test script: tox -e py27 script: tox -e py36 python34: image: python:3.4 python37: image: python:3.7 stage: test script: tox -e py34 script: tox -e py37 python35: image: python:3.5 python38: image: python:3.8 stage: test script: tox -e py35 script: tox -e py38 python36: image: python:3.6 python39: image: python:3.9 stage: test script: tox -e py36 script: tox -e py39 linters: image: python:3.5 image: python:3.9 stage: test script: tox -e linters Loading CHANGES.txt +29 −0 Original line number Diff line number Diff line Changes ================== 0.7 (2021-03-06) ---------------- * BREAKING: ``Ghostscript()`` no longer allows passing arbitrary keyword arguments. * The high-level interface now allows passing unicode strings as arguments. Passing bytes as arguments is still possible, but now deprecated. * The high-level interface now requires ghostscript >= 9.0.8 (released 2013-08-14). * Allow multiple Ghostscript instances. Actually using this requires the library is compiled with -DGS_THREADSAFE. * Ensure proper clean-up on error. * High-level revision() now returns unicode strings instead of byte strings. * Add low-level interface for set_arg_encoding(). * Miscellaneous small fixes. * Drop support for Python 2.7, 3.4 and 3.5. Minimum required Python version is now 3.6. :0.6 (2018-01-16): * Add support for Python 3.x (tested with Python 3.4). Loading MANIFEST.in +3 −4 Original line number Diff line number Diff line include COPYING include README.txt exclude .hgignore exclude .hgtags recursive-include tests *.xml *.py recursive-include doc *.html *.1 exclude .gitgnore recursive-include test *.xml *.py *.bmp #recursive-include doc *.html *.1 README.rst +4 −4 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ Python-Interface to the Ghostscript C-API --------------------------------------------------------------------- :Author: Hartmut Goebel <h.goebel@crazy-compiler.com> :Version: 0.6 :License: GNU Public License v3 (GPLv3) :Version: 0.7 :License: GNU General Public License v3 or later (GPLv3+) :Homepage: https://gitlab.com/pdftools/python-ghostscript `Ghostscript`__ is a well known interpreter for the PostScript Loading Loading @@ -83,9 +83,9 @@ Requirements and Installation `python-ghostscript` requires * `Python`__ 2.7 or higher (tested with Python 2.7, 3.4, 3.6 and 3.6) * `Python`__ 3.6 or higher (tested with Python 3.6–3.9) * `setuptools`__ for installation (see below) * `Ghostscript`__ Version 8.x or higher (tested with 9.x) * `Ghostscript`__ Version 9.0.8 or higher __ http://www.python.org/download/ __ http://pypi.python.org/pypi/setuptools Loading _zest_release_hooks.py 0 → 100644 +58 −0 Original line number Diff line number Diff line # Copyright 2020-2021 Hartmut Goebel <h.goebel@crazy-compilers.com> # This file is licensed under the # GNU Affero General Public License v3 or later (AGPLv3+) # SPDX-License-Identifier: AGPL-3.0-or-later import glob import os import shutil import subprocess import sys import zest.releaser.utils def sign_release(data): "Sign the archive that will be uploaded to PYPI." # zest.releaser does a clean checkout where it generates tgz/zip in 'dist' # directory and those files will be then uploaded to pypi. dist_dir = os.path.join(data['tagdir'], 'dist') cmd = ['gpg', '--detach-sign', '--armor'] codesigning_id = os.getenv("CODESIGNING_ID") if not codesigning_id: rc, codesigning_id = subprocess.getstatusoutput( "git config --get user.signingkey") if rc: raise SystemExit(f"ERROR in sign_release hook: {codesigning_id}") codesigning_id = None if codesigning_id: print("Using gpg identity", codesigning_id, "for signing.") cmd.extend(['--local-user', codesigning_id]) # Sign all files in the 'dist' directory. for f in list(os.listdir(dist_dir)): f = os.path.join(dist_dir, f) print('Signing file %s' % f) subprocess.run(cmd + [f]) def run_twine_check(data): import twine.cli dist_dir = os.path.join(data['tagdir'], 'dist') dist_files = list(glob.glob(os.path.join(dist_dir, "*"))) twine.cli.dispatch(["check"] + dist_files) def safe_dist_files(data): repo_dist_dir = os.path.join(data['reporoot'], 'dist') dist_dir = os.path.join(data['tagdir'], 'dist') dist_files = glob.glob(os.path.join(dist_dir, "*")) for fn in sorted(os.listdir(dist_dir)): src = os.path.join(dist_dir, fn) dest = os.path.join(repo_dist_dir, fn) if (os.path.exists(dest) and not zest.releaser.utils.ask("Overwrite dist/%s" % fn, default=True)): # skip this file print("Skipping", fn) continue print("Saving", fn) shutil.copy2(src, dest) Loading
.gitlab-ci.yml +13 −15 Original line number Diff line number Diff line Loading @@ -7,32 +7,30 @@ stages: before_script: - apt-get update -qq && apt-get install -y -q ghostscript - curl -O https://bootstrap.pypa.io/get-pip.py - python get-pip.py - pip install -r requirements.txt python2: image: python:2.7 python36: image: python:3.6 stage: test script: tox -e py27 script: tox -e py36 python34: image: python:3.4 python37: image: python:3.7 stage: test script: tox -e py34 script: tox -e py37 python35: image: python:3.5 python38: image: python:3.8 stage: test script: tox -e py35 script: tox -e py38 python36: image: python:3.6 python39: image: python:3.9 stage: test script: tox -e py36 script: tox -e py39 linters: image: python:3.5 image: python:3.9 stage: test script: tox -e linters Loading
CHANGES.txt +29 −0 Original line number Diff line number Diff line Changes ================== 0.7 (2021-03-06) ---------------- * BREAKING: ``Ghostscript()`` no longer allows passing arbitrary keyword arguments. * The high-level interface now allows passing unicode strings as arguments. Passing bytes as arguments is still possible, but now deprecated. * The high-level interface now requires ghostscript >= 9.0.8 (released 2013-08-14). * Allow multiple Ghostscript instances. Actually using this requires the library is compiled with -DGS_THREADSAFE. * Ensure proper clean-up on error. * High-level revision() now returns unicode strings instead of byte strings. * Add low-level interface for set_arg_encoding(). * Miscellaneous small fixes. * Drop support for Python 2.7, 3.4 and 3.5. Minimum required Python version is now 3.6. :0.6 (2018-01-16): * Add support for Python 3.x (tested with Python 3.4). Loading
MANIFEST.in +3 −4 Original line number Diff line number Diff line include COPYING include README.txt exclude .hgignore exclude .hgtags recursive-include tests *.xml *.py recursive-include doc *.html *.1 exclude .gitgnore recursive-include test *.xml *.py *.bmp #recursive-include doc *.html *.1
README.rst +4 −4 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ Python-Interface to the Ghostscript C-API --------------------------------------------------------------------- :Author: Hartmut Goebel <h.goebel@crazy-compiler.com> :Version: 0.6 :License: GNU Public License v3 (GPLv3) :Version: 0.7 :License: GNU General Public License v3 or later (GPLv3+) :Homepage: https://gitlab.com/pdftools/python-ghostscript `Ghostscript`__ is a well known interpreter for the PostScript Loading Loading @@ -83,9 +83,9 @@ Requirements and Installation `python-ghostscript` requires * `Python`__ 2.7 or higher (tested with Python 2.7, 3.4, 3.6 and 3.6) * `Python`__ 3.6 or higher (tested with Python 3.6–3.9) * `setuptools`__ for installation (see below) * `Ghostscript`__ Version 8.x or higher (tested with 9.x) * `Ghostscript`__ Version 9.0.8 or higher __ http://www.python.org/download/ __ http://pypi.python.org/pypi/setuptools Loading
_zest_release_hooks.py 0 → 100644 +58 −0 Original line number Diff line number Diff line # Copyright 2020-2021 Hartmut Goebel <h.goebel@crazy-compilers.com> # This file is licensed under the # GNU Affero General Public License v3 or later (AGPLv3+) # SPDX-License-Identifier: AGPL-3.0-or-later import glob import os import shutil import subprocess import sys import zest.releaser.utils def sign_release(data): "Sign the archive that will be uploaded to PYPI." # zest.releaser does a clean checkout where it generates tgz/zip in 'dist' # directory and those files will be then uploaded to pypi. dist_dir = os.path.join(data['tagdir'], 'dist') cmd = ['gpg', '--detach-sign', '--armor'] codesigning_id = os.getenv("CODESIGNING_ID") if not codesigning_id: rc, codesigning_id = subprocess.getstatusoutput( "git config --get user.signingkey") if rc: raise SystemExit(f"ERROR in sign_release hook: {codesigning_id}") codesigning_id = None if codesigning_id: print("Using gpg identity", codesigning_id, "for signing.") cmd.extend(['--local-user', codesigning_id]) # Sign all files in the 'dist' directory. for f in list(os.listdir(dist_dir)): f = os.path.join(dist_dir, f) print('Signing file %s' % f) subprocess.run(cmd + [f]) def run_twine_check(data): import twine.cli dist_dir = os.path.join(data['tagdir'], 'dist') dist_files = list(glob.glob(os.path.join(dist_dir, "*"))) twine.cli.dispatch(["check"] + dist_files) def safe_dist_files(data): repo_dist_dir = os.path.join(data['reporoot'], 'dist') dist_dir = os.path.join(data['tagdir'], 'dist') dist_files = glob.glob(os.path.join(dist_dir, "*")) for fn in sorted(os.listdir(dist_dir)): src = os.path.join(dist_dir, fn) dest = os.path.join(repo_dist_dir, fn) if (os.path.exists(dest) and not zest.releaser.utils.ask("Overwrite dist/%s" % fn, default=True)): # skip this file print("Skipping", fn) continue print("Saving", fn) shutil.copy2(src, dest)