[Git][debian-gis-team/pydecorate][upstream] New upstream version 0.3.1
Antonio Valentino
gitlab at salsa.debian.org
Sun Apr 12 08:42:52 BST 2020
Antonio Valentino pushed to branch upstream at Debian GIS Project / pydecorate
Commits:
58eec7a5 by Antonio Valentino at 2020-04-12T06:18:31+00:00
New upstream version 0.3.1
- - - - -
20 changed files:
- + .git_archival.txt
- + .gitattributes
- .gitignore
- .travis.yml
- + CHANGELOG.md
- MANIFEST.in
- + RELEASING.md
- appveyor.yml
- − doc/source/api.rst
- + doc/source/api/pydecorate.fonts.rst
- + doc/source/api/pydecorate.rst
- doc/source/conf.py
- doc/source/index.rst
- doc/source/installation.rst
- pydecorate/__init__.py
- pydecorate/decorator_agg.py
- pydecorate/decorator_base.py
- − pydecorate/version.py
- + pyproject.toml
- setup.py
Changes:
=====================================
.git_archival.txt
=====================================
@@ -0,0 +1 @@
+ref-names: HEAD -> master, tag: v0.3.1
=====================================
.gitattributes
=====================================
@@ -0,0 +1 @@
+.git_archival.txt export-subst
=====================================
.gitignore
=====================================
@@ -1,3 +1,6 @@
+# Setuptools SCM version.py file
+pydecorate/version.py
+
### PYTHON IGNORES ###
*.py[cod]
__pycache__/
=====================================
.travis.yml
=====================================
@@ -3,37 +3,33 @@ env:
global:
- NUMPY_VERSION=stable
- MAIN_CMD='python setup.py'
- - CONDA_DEPENDENCIES='sphinx pillow coveralls coverage codecov mock trollimage aggdraw
+ - CONDA_DEPENDENCIES='sphinx pillow coveralls coverage codecov trollimage aggdraw
pytest pytest-cov'
- PIP_DEPENDENCIES=''
- SETUP_XVFB=False
- EVENT_TYPE='push pull_request'
- SETUP_CMD='test'
- CONDA_CHANNELS='conda-forge'
+ - CONDA_CHANNEL_PRIORITY='strict'
matrix:
include:
- - env: PYTHON_VERSION=2.7
+ - env: PYTHON_VERSION=3.8
os: linux
language: generic
- - env: PYTHON_VERSION=2.7
- os: osx
- language: generic
- - env: PYTHON_VERSION=3.6
+ - env: PYTHON_VERSION=3.7
os: linux
language: generic
- - env: PYTHON_VERSION=3.6
+ - env: PYTHON_VERSION=3.8
os: osx
language: generic
install:
- git clone --depth 1 git://github.com/astropy/ci-helpers.git
- source ci-helpers/travis/setup_conda.sh
-# See https://github.com/conda/conda/issues/7626#issuecomment-412922028
-- conda config --remove channels defaults
-- conda install -y $CONDA_DEPENDENCIES
+- pip install --no-deps -e .
script:
- pytest --cov=pydecorate test.py
after_success:
-- if [[ $PYTHON_VERSION == 3.6 ]]; then coveralls; codecov; fi
+- if [[ $PYTHON_VERSION == 3.8 ]]; then coveralls; codecov; fi
deploy:
- provider: pypi
user: dhoese
=====================================
CHANGELOG.md
=====================================
@@ -0,0 +1,35 @@
+## Version 0.3.1 (2020/04/06)
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 14](https://github.com/pytroll/pydecorate/pull/14) - Fix font loading when adding scale (colorbar)
+
+In this release 1 pull request was closed.
+
+
+## Version 0.3.0 (2020/04/06)
+
+### Issues Closed
+
+* [Issue 10](https://github.com/pytroll/pydecorate/issues/10) - Incorrect font parameter description in documentation for add_text
+
+In this release 1 issue was closed.
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 11](https://github.com/pytroll/pydecorate/pull/11) - Fix font error when font is used by multiple features
+* [PR 9](https://github.com/pytroll/pydecorate/pull/9) - Add "check for font object" in "title" section
+
+#### Features added
+
+* [PR 12](https://github.com/pytroll/pydecorate/pull/12) - Drop python 2 and switch to automatic version numbers
+
+#### Documentation changes
+
+* [PR 13](https://github.com/pytroll/pydecorate/pull/13) - Update installation instructions to use conda and github
+
+In this release 4 pull requests were closed.
=====================================
MANIFEST.in
=====================================
@@ -1,4 +1,6 @@
recursive-include docs/source *
include docs/Makefile
recursive-include pydecorate/fonts *
-include LICENSE.txt
\ No newline at end of file
+include README.rst
+include LICENSE.txt
+include pydecorate/version.py
\ No newline at end of file
=====================================
RELEASING.md
=====================================
@@ -0,0 +1,37 @@
+# Releasing Pydecorate
+
+1. checkout master
+2. pull from repo
+3. run the unittests
+4. run `loghub`. Replace <github username> and <previous version> with proper
+ values. To get the previous version run `git tag` and select the most
+ recent with highest version number.
+
+```
+loghub pytroll/pydecorate -u <github username> -st v<previous version> -plg bug "Bugs fixed" -plg enhancement "Features added" -plg documentation "Documentation changes" -plg backwards-incompatibility "Backwards incompatible changes"
+```
+
+This command will create a CHANGELOG.temp file which need to be added
+to the top of the CHANGELOG.md file. The same content is also printed
+to terminal, so that can be copy-pasted, too. Remember to update also
+the version number to the same given in step 5. Don't forget to commit
+CHANGELOG.md!
+
+5. Create a tag with the new version number, starting with a 'v', eg:
+
+```
+git tag -a v<new version> -m "Version <new version>"
+```
+
+For example if the previous tag was `v0.9.0` and the new release is a
+patch release, do:
+
+```
+git tag -a v0.9.1 -m "Version 0.9.1"
+```
+
+See [semver.org](http://semver.org/) on how to write a version number.
+
+
+6. push changes to github `git push --follow-tags`
+7. Verify travis tests passed and deployed sdist and wheel to PyPI
=====================================
appveyor.yml
=====================================
@@ -3,32 +3,27 @@ environment:
PYTHON: "C:\\conda"
MINICONDA_VERSION: "latest"
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd"
- CONDA_DEPENDENCIES: "sphinx pillow coverage mock trollimage aggdraw pytest pytest-cov"
+ CONDA_DEPENDENCIES: "sphinx pillow coverage trollimage aggdraw pytest pytest-cov"
PIP_DEPENDENCIES: ""
CONDA_CHANNELS: "conda-forge"
matrix:
- - PYTHON: "C:\\Python27_64"
- PYTHON_VERSION: "2.7"
- PYTHON_ARCH: "64"
- NUMPY_VERSION: "stable"
-
- - PYTHON: "C:\\Python36_64"
- PYTHON_VERSION: "3.6"
+ - PYTHON: "C:\\Python38_64"
+ PYTHON_VERSION: "3.8"
PYTHON_ARCH: "64"
NUMPY_VERSION: "stable"
install:
- "git clone --depth 1 git://github.com/astropy/ci-helpers.git"
- "powershell ci-helpers/appveyor/install-miniconda.ps1"
- - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- - "activate test"
+ - "conda activate test"
+ - "pip install --no-deps -e ."
build: false # Not a C# project, build stuff at the test step instead.
test_script:
# Build the compiled extension and run the project tests
- - "%CMD_IN_ENV% pytest test.py"
+ - "%CMD_IN_ENV% pytest --cov=pydecorate test.py"
after_test:
# If tests are successful, create a whl package for the project.
=====================================
doc/source/api.rst deleted
=====================================
@@ -1,21 +0,0 @@
-The :mod:`pydecorate` API
-===============================
-
-Base decorator
----------------------------
-The basic decorator interface defined here,
-usually not instantiated by the user.
-
-.. automodule:: pydecorate.DecoratorBase
- :members:
- :undoc-members:
-
-Aggdraw based decorator
----------------------------
-Antialiased implementation of the decorator,
-inheriting from the pydecorate.DecoraterBase class.
-
-.. automodule:: pydecorate.DecoratorAGG
- :members:
- :undoc-members:
-
=====================================
doc/source/api/pydecorate.fonts.rst
=====================================
@@ -0,0 +1,10 @@
+pydecorate.fonts package
+========================
+
+Module contents
+---------------
+
+.. automodule:: pydecorate.fonts
+ :members:
+ :undoc-members:
+ :show-inheritance:
=====================================
doc/source/api/pydecorate.rst
=====================================
@@ -0,0 +1,45 @@
+pydecorate package
+==================
+
+Subpackages
+-----------
+
+.. toctree::
+
+ pydecorate.fonts
+
+Submodules
+----------
+
+pydecorate.decorator module
+---------------------------
+
+.. automodule:: pydecorate.decorator
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+pydecorate.decorator\_agg module
+--------------------------------
+
+.. automodule:: pydecorate.decorator_agg
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+pydecorate.decorator\_base module
+---------------------------------
+
+.. automodule:: pydecorate.decorator_base
+ :members:
+ :undoc-members:
+ :show-inheritance:
+
+
+Module contents
+---------------
+
+.. automodule:: pydecorate
+ :members:
+ :undoc-members:
+ :show-inheritance:
=====================================
doc/source/conf.py
=====================================
@@ -11,7 +11,12 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+# To generate apidoc modules:
+# sphinx-apidoc -f -T -o source/api ../pydecorate ../pydecorate/tests
+
+import os
+import sys
+from pkg_resources import get_distribution
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -47,10 +52,11 @@ copyright = u'2013, Hrobjartur Thorsteinsson'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
-# The short X.Y version.
-version = '0.1'
+# get version using setuptools-scm
+release = get_distribution('pydecorate').version
# The full version, including alpha/beta/rc tags.
-release = '0.1.0'
+# for example take major/minor
+version = '.'.join(release.split('.')[:2])
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
=====================================
doc/source/index.rst
=====================================
@@ -4,10 +4,8 @@
contain the root `toctree` directive.
.. meta::
- description: Python project adding logos, texts, and color scales to PIL
- images
- keywords: Python, image, PIL, Pytroll, pydecorate, trollimage, logos,
- palette, color scale, text
+ :description: Python project adding logos, texts, and color scales to PIL images
+ :keywords: Python, image, PIL, Pytroll, pydecorate, trollimage, logos, palette, color scale, text
Welcome to the Pydecorate documentation!
=========================================
@@ -15,23 +13,22 @@ Welcome to the Pydecorate documentation!
Pydecorate is a package for decorating PIL images with logos, texts, and color
scales.
-The source code of the package can be found at google codes, googlecode_
+The source code of the package can be found at on GitHub_.
-.. _googlecode: http://code.google.com/p/pydecorate/
+.. _GitHub: https://github.com/pytroll/pydecorate
Contents
-+++++++++
+++++++++
.. toctree::
:maxdepth: 3
installation
usage
- examples
- api
+ Pydecorate API <api/pydecorate>
Indices and tables
-+++++++++++++++++++
+++++++++++++++++++
* :ref:`genindex`
* :ref:`modindex`
=====================================
doc/source/installation.rst
=====================================
@@ -6,49 +6,24 @@
:suffix: .
Installation
-------------
+============
-You can download the pydecorate source code from googlecodes,::
+Pydecorate can be installed in a conda environment by using the conda-forge
+channel::
- $> git clone https://code.google.com/p/pydecorate/
+ conda install -c conda-forge pydecorate
-and then run::
+Or using pip::
- $> python setup.py install
+ pip install pydecorate
+Development Installation
+------------------------
+To install from source, clone the git repository::
-Transparency and antialiasing using AGG
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-The default plotting mode of pydecorate uses PIL for rendering.
-However, PIL does not support antialiasing and opacity.
-The AGG engine can be used for making high quality images using the aggdraw_ module.
-
-First make sure you have libfreetype and it's development files installed - on debian based systems you might do:
-
-.. code-block:: bash
-
- $> sudo apt-get install libfreetype6 libfreetype6-dev
-
-First install the aggdraw_ module. Please not that aggdraw_ is getting old and may have the following problems in building.
-pip and easy_install may not solve these problems, so we recommend manual install.
-
-With the current source of aggdraw_, it is necessary to point the build at the root of
-Freetype install. To do this you must edit the aggdraw setup.py file, usually setting *FREETYPE_ROOT = "/usr"*
-This is necessary for aggdraw to render text.
-
-If the building of aggdraw fails with:
-
-.. code-block:: bash
-
- agg_array.h:523: error: cast from ‘agg::int8u*’ to ‘unsigned int’ loses precision
-
-Try:
-
-.. code-block:: bash
-
- export CFLAGS="-fpermissive"
-
-before building.
+ git clone https://github.com/pytroll/pydecorate.git
+Then use pip to install the package in development mode::
+ pip install -e .
=====================================
pydecorate/__init__.py
=====================================
@@ -16,4 +16,10 @@
#You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+try:
+ from .version import version as __version__ # noqa
+except ImportError:
+ # package is not installed
+ pass
+
from pydecorate.decorator_agg import DecoratorAGG
=====================================
pydecorate/decorator_agg.py
=====================================
@@ -17,12 +17,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from pydecorate.decorator_base import DecoratorBase
-try:
- from PIL import ImageDraw
-except ImportError:
- print("ImportError: Missing module: ImageDraw")
-
-
class DecoratorAGG(DecoratorBase):
def add_scale(self, colormap, **kwargs):
=====================================
pydecorate/decorator_base.py
=====================================
@@ -242,8 +242,10 @@ class DecoratorBase(object):
def _get_current_font(self):
if self.style['font'] is None:
self.style['font'] = self._load_default_font()
- else:
+ elif isinstance(self.style['font'], str):
self.style['font'] = self._load_font()
+ else:
+ pass # assume self.style['font'] has already been assigned as Font obj. FIXME
def _add_text(self, txt, **kwargs):
# synchronize kwargs into style
@@ -431,6 +433,9 @@ class DecoratorBase(object):
# draw object
draw = self._get_canvas(self.image)
+ # check for font object
+ self._get_current_font()
+
# draw base
px = (self.style['propagation'][0] +
self.style['newline_propagation'][0])
@@ -544,6 +549,9 @@ class DecoratorBase(object):
self._draw_text(draw, (x_, y_), self.style['unit'], **self.style)
if title:
+ # check for font object
+ self._get_current_font()
+
# calculate position
tw, th = draw.textsize(title, self.style['font'])
if is_vertical:
=====================================
pydecorate/version.py deleted
=====================================
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# Copyright (c) 2013 Hrobjartur Thorsteinsson
-
-# Author(s):
-
-# Hrobjartur Thorsteinsson <thorsteinssonh at gmail.com>
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-"""
-"""
-
-__version__ = '0.2.1'
=====================================
pyproject.toml
=====================================
@@ -0,0 +1,5 @@
+[build-system]
+requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4", "setuptools_scm_git_archive"]
+
+[tool.setuptools_scm]
+write_to = "pydecorate/version.py"
\ No newline at end of file
=====================================
setup.py
=====================================
@@ -21,21 +21,23 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-try:
- with open("./README", "r") as fd:
- long_description = fd.read()
-except IOError:
- long_description = ""
+from setuptools import setup
+try:
+ # HACK: https://github.com/pypa/setuptools_scm/issues/190#issuecomment-351181286
+ # Stop setuptools_scm from including all repository files
+ import setuptools_scm.integration
+ setuptools_scm.integration.find_files = lambda _: []
+except ImportError:
+ pass
-from setuptools import setup
-import imp
+with open("./README.rst", "r") as fd:
+ long_description = fd.read()
-version = imp.load_source('pydecorate.version', 'pydecorate/version.py')
setup(name='pydecorate',
- version=version.__version__,
description='Decorating PIL images: logos, texts, pallettes',
+ long_description=long_description,
author='Hrobjartur Thorsteinsson',
author_email='thorsteinssonh at gmail.com',
classifiers=["Development Status :: 4 - Beta",
@@ -46,7 +48,6 @@ setup(name='pydecorate',
"Programming Language :: Python",
"Topic :: Scientific/Engineering"],
url="https://github.com/pytroll/pydecorate",
- long_description=long_description,
license='GPLv3',
packages=['pydecorate'],
include_package_data=True,
@@ -54,9 +55,11 @@ setup(name='pydecorate',
# Project should use reStructuredText, so ensure that the docutils get
# installed or upgraded on the target machine
install_requires=['pillow', 'aggdraw'],
+ setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'],
scripts=[],
data_files=[],
# test_suite="",
- tests_require=['pytest', 'mock'],
- python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
+ tests_require=['pytest'],
+ python_requires='>=3.6',
+ use_scm_version={'write_to': 'pydecorate/version.py'},
zip_safe=False)
View it on GitLab: https://salsa.debian.org/debian-gis-team/pydecorate/-/commit/58eec7a59c0d23388f265fd3361f54f5c2acb4d5
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/pydecorate/-/commit/58eec7a59c0d23388f265fd3361f54f5c2acb4d5
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20200412/e14553d5/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list