Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation on how to install, setup, and test code #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language: python
python:
- 3.8
- 3.7
- 3.6
- 3.5
Expand Down
81 changes: 81 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# How to contribute

Thanks for reading!

You can help by:

* Reporting any issues and requesting enhancements,
* Updating documentation, or...
* Modifying code and submitting a pull request.

## Reporting issues and requesting enhancements

Issues and enhancements can be reported on [pangocffi issues on GitHub].

[pangocffi issues on GitHub]: https://github.com/leifgehrmann/pangocffi/issues/new).

## Modifying documentation

Any changes to the documentation can be generated and viewed:

```bash
$ make docs
```

## Modifying code

You'll first need to setup a development environment. You will need to install
the following

Then run the following:

```bash
$ pip install setuptools
$ pip install -r requirements.txt
```

### Testing code changes

A quick test can be done by running:

```bash
$ make tests
```

But for completeness, it's recommended to run tests for *all* python
interpreters using tox:

```bash
$ make tests-all
```

### Formatting

This repository uses [flake8] to enforce various linting rules. To check your
code complies, run:

```bash
$ make lint
```

[flake8]: https://gitlab.com/pycqa/flake8

## Making a new release

This project uses SemVer for managing version numbers. The version number in
the file `pangocffi/VERSION` should be updated, and committed before a new
release.

After this change has been merged into master, a new release on GitHub should
be made. Changes in the release should be added to the Releases section on
GitHub.

Finally, with the tagged version checked out on a machine, run the following:

```bash
$ make release
```

This command will prompt for username and password of the PyPi account. Making
a release requires credentials of the project owner. If you would like to be
co-owner of the project, do not hesitate to ask!
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,16 @@ generate-cdefs: ## generate pango c definitions (requires a cloned copy of pango
lint: ## check style with flake8
flake8 pangocffi tests --exclude pangocffi/_generated/ffi.py

.PHONY: tests
tests: ## run tests quickly with the default Python
python setup.py test

tests-all-setup:
pyenv install 3.5.9
pyenv install 3.6.9
pyenv install 3.7.5
pyenv install 3.8.0

tests-all: clean ## run tests on all minor python versions
tox

Expand Down
76 changes: 0 additions & 76 deletions NEWS.rst

This file was deleted.

44 changes: 44 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# pangocffi

[![Latest PyPi Release](https://img.shields.io/pypi/v/pangocffi.svg)](https://pypi.python.org/pypi/pangocffi)
[![Supported Python Versions](https://img.shields.io/pypi/pyversions/pangocffi.svg?style=flat)](https://pypi.python.org/pypi/pangocffi)
[![Build Status](https://travis-ci.org/leifgehrmann/pangocffi.svg?branch=master)](https://travis-ci.org/leifgehrmann/pangocffi)
[![Documentation Status](https://readthedocs.org/projects/pangocffi/badge/?version=latest)](https://pangocffi.readthedocs.io/en/latest/?badge=latest)
[![Code Coverage](https://codecov.io/gh/leifgehrmann/pangocffi/branch/master/graph/badge.svg)](https://codecov.io/gh/leifgehrmann/pangocffi)

pangocffi is a [CFFI]-based set of Python bindings for [pango].

pangocffi on its own is not that useful, since it depends on a PangoFontMap
being declared against the PangoContext.
PangoFontMap instances can easily be retrieved from libraries such as
PangoCairo, PangoXft, PangoFT2, and PangoWin32 (See gnome's documentation
['Rendering with Pango'] for a list of rendering engines).

See [pangocairocffi] for bindings that allow you to render pango objects with
cairo.

[pangocairocffi]: https://github.com/leifgehrmann/pangocairocffi
['Rendering with Pango']: https://developer.gnome.org/pango/stable/rendering.html


The bindings are currently not fully implemented. Feel free to make a pull
request to contribute!

[CFFI]: https://cffi.readthedocs.org/
[pango]: https://pango.org/

## Installation and usage

See ['Overview'] for information on how to install the necessary libraries.

See ['Python API Reference'] for additional information on all the objects.

['Overview']: https://pangocffi.readthedocs.io/en/latest/overview.html
['Python API Reference']: https://pangocffi.readthedocs.io/en/latest/modules.html

## Contributing

If you would like to contribute to this project, either by leaving feedback or
submitting a pull request, please read '[CONTRIBUTING.md]'.

[CONTRIBUTING.md]: CONTRIBUTING.md
42 changes: 0 additions & 42 deletions README.rst

This file was deleted.

8 changes: 7 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
.. include:: ../NEWS.rst
Changelog
---------

See the `Releases section on GitHub`_ for a description of changes between each
version.

.. _Releases section on GitHub: https://github.com/leifgehrmann/pangocffi/releases
6 changes: 6 additions & 0 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Changelog
---------

See `CONTRIBUTING.md on GitHub`_ for information on how to contribute!

.. _CONTRIBUTING.md on GitHub: https://github.com/leifgehrmann/pangocffi/blob/master/CONTRIBUTING.md
26 changes: 25 additions & 1 deletion docs/pangocffi.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,27 @@
.. include:: ../README.rst
pangocffi
=========

pangocffi is a `CFFI`_-based set of Python bindings for pango_.

pangocffi on its own is not that useful, since it depends on a PangoFontMap
being declared against the PangoContext.
PangoFontMap instances can easily be retrieved from libraries such as
PangoCairo, PangoXft, PangoFT2, and PangoWin32 (See gnome's documentation
`'Rendering with Pango'`_ for a list of rendering engines).

See pangocairocffi_ for bindings that allow you to render pango objects with
cairo.

.. _pangocairocffi: https://github.com/leifgehrmann/pangocairocffi
.. _'Rendering with Pango': https://developer.gnome.org/pango/stable/rendering.html


The bindings are currently not fully implemented. Feel free to make a pull
request to contribute!

.. _CFFI: https://cffi.readthedocs.org/
.. _pango: https://pango.org/


Documentation
-------------
Expand All @@ -10,3 +33,4 @@ Documentation
cffi-api
binding-progress
changelog
contributing
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
cffi >= 1.1.0
flake8
pip
pytest
setuptools
sphinx
tox
twine
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py35, py36, py37
envlist = py35, py36, py37, py38

[testenv]
# Skip the install because tox will want to use bdist_wheel, which pangocffi
Expand Down