6131 Commits

Author SHA1 Message Date
Cosimo Lupo
ffa03f6566 [py23] add round2 and round3 function for simulating Python 2 and Python 3 built-in round
The implementation is inspired by https://github.com/PythonCharmers/python-future/blob/master/src/future/builtins/newround.py

It adds support for the old Python 2 round, and for negative 'ndigits'
2016-09-13 07:13:32 +01:00
Adrien Tétar
ce2923fec0 Merge pull request #40 from anthrotype/tests
Set up CI to run pytest with tox; prepare auto-deployment
2016-09-11 18:49:03 +02:00
Cosimo Lupo
f320554077 ufoLib.__init__: use os.path instead of slash to fix doctest failing on Windows 2016-09-11 17:44:12 +01:00
Cosimo Lupo
8db42c8e37 appveyor.yml: run tests with pytest inside tox environment 2016-09-11 17:06:39 +01:00
Cosimo Lupo
6a0790a645 .travis.yml: add (commented-out) 'deploy') section for Github and PyPI
someone with push access must encrypt the Github api token and the PyPI password
2016-09-11 17:00:13 +01:00
Cosimo Lupo
b497dce200 .travis.yml: run tests with pytest inside tox environment; sudo is not required, use the Travis container-based infrastructure (faster) 2016-09-11 17:00:13 +01:00
Cosimo Lupo
908cff36ad add tox.ini configuration file
install package and run tests in isolated virtual environments
2016-09-11 17:00:13 +01:00
Cosimo Lupo
8747da76a4 filenames.py: fix doctests for py2.py3; import unicode_literals 2016-09-11 17:00:13 +01:00
Cosimo Lupo
ee38446982 glifLib.py: use +IGNORE_EXCEPTION_DETAIL to make doctest work on both Python2 and 3
http://python3porting.com/problems.html#handling-expected-exceptions
2016-09-11 17:00:13 +01:00
Cosimo Lupo
5fb9a13957 converters.py: fix up kerningValidator doctest 2016-09-11 17:00:13 +01:00
Cosimo Lupo
730a673c3a setup.cfg: set universal wheel; use zip as sdist format; add test=pytest alias; add default pytest config 2016-09-11 17:00:13 +01:00
Cosimo Lupo
a14810a036 add requirements.txt file 2016-09-11 17:00:13 +01:00
Cosimo Lupo
6f6a10dfa2 setup.py: add pytest runner; only use setuptools, drop distutils; set version 2.0.dev1; pep8 whitespace 2016-09-11 17:00:12 +01:00
Cosimo Lupo
78f7d02d6b add MANIFEST.in to include extra files in source distribution 2016-09-11 17:00:12 +01:00
Denis Moyogo Jacquerye
7930106740 feaLib: limit language statements to 1 feature block (#658)
* feaLib: limit language statements to 1 feature block

language exclude_dflt statements should only apply to lookups
defined in their feature block and not to lookups defined
in previous blocks sharing the same feature tag

* feaLib: add BuilderTest::test_FeatureFile_multiple_feature_blocks
2016-08-30 19:44:33 +02:00
Sascha Brawer
aa3b27c663 Merge pull request #655 from JasonAtGithub/master
Fixed encoding error in subset tool in Windows
2016-08-29 15:07:56 +02:00
JasonAtGithub
c61fcb9122 Merge pull request #1 from JasonAtGithub/JasonAtGithub-patch-1
Fixed encoding error in subset tool in Windows
2016-08-29 20:50:41 +08:00
JasonAtGithub
a41c60cb88 Fixed encoding error in subset tool in Windows
Fixed encoding error in subset tool in Windows which system default codepage isn't 65001.
For Example: 
When windows default codepage is 936, the command like 'pyftsubset myfont.ttf --text-file=mytextfile.txt' will throw an exception.
2016-08-29 20:43:33 +08:00
Cosimo Lupo
14740f8ee5 Merge pull request #653 from miguelsousa/cpal
[CPAL] XML enhancements
2016-08-29 12:06:38 +02:00
Miguel Sousa
f502bbba98 [CPAL] write paletteEntryLabels names 2016-08-28 16:24:58 -07:00
Miguel Sousa
3c6537de88 [CPAL] remove extra newline before palette label name 2016-08-28 16:21:21 -07:00
Cosimo Lupo
6ae2a9200e Revert "MANIFEST.in: exclude 'Doc/ttx.1'"
Fixes Travis CI build #1120
https://travis-ci.org/behdad/fonttools/builds/153766422
2016-08-20 11:40:52 +01:00
Cosimo Lupo
c8135baed5 setup.py: install the ttx 'man' page only on Linux 2016-08-20 11:35:49 +01:00
Cosimo Lupo
dd5d442ea6 Revert "Remove old 'Doc/ttx.1'"
This reverts commit fe90e12601b9bea3983ddc1c0ec58303d14bbbe3.

Khaled commented:

> We either need to update the man page or find a way to generate it from other
existing documentation, not just drop it entirely with no replacement

fe90e12601 (commitcomment-18713586)
2016-08-20 11:30:18 +01:00
Cosimo Lupo
48957964bd MANIFEST.in: include 'run-tests.sh' 2016-08-20 01:23:54 +01:00
Cosimo Lupo
51d335c0dc Revert "remove 'run-tests.sh'"
This reverts commit ac7fca7141f4bc81774f97496fda958152aaa3c6.

As the old saying goes, a shell script is worth a thousand words...
2016-08-20 01:20:19 +01:00
Cosimo Lupo
d2e73ca1ab remove 'fontTools' symbolic link in Snippets as not cross-plaftorm 2016-08-19 14:41:18 +01:00
Cosimo Lupo
3cbc97885f MANIFEST.in: use correct glob pattern to only include files under 'testdata' subfolders 2016-08-19 14:38:24 +01:00
Cosimo Lupo
5f94d8b2df MANIFEST.in: include all the files that should be included in source dist
One notable absence was README.md... :)

For the testdata/*, I now use `include_package_data=True` in setup.py, to automatically install any data files found inside package directories that are also specified in MANIFEST.in file.

I also include the Snippets, which I think should belong to the source distribution, despite not being installed as console scripts like ttx, etc.

The MANIFEST.in does not need to include itself (done by default).
2016-08-19 14:21:33 +01:00
Cosimo Lupo
3796a8ba05 setup.py: add 'package_data' for test files
There's no point in installing the test modules if we don't also install the test data.

(BTW, all this stuff would not be necessary if we were to use 'setuptools_scm'
which would just include in the distribution all the files which are tracked by
git version control...)
2016-08-19 13:02:03 +01:00
Cosimo Lupo
d17578f7ea MANIFEST.in: exclude 'Doc/ttx.1', as it was removed 2016-08-19 12:32:39 +01:00
Cosimo Lupo
fe90e12601 Remove old 'Doc/ttx.1' man page as outdated, not working on Mac/Windows
The file contains outdated information and nobody is maintaining it any longer.
Plus it only works on Linux, and only if pip installing as sudo (which is bad!).

We need proper Sphinx+ReadTheDocs kind of documentation.
2016-08-19 12:27:09 +01:00
Cosimo Lupo
aef600e914 setup.cfg: use --formats=zip for sdist packages as it's more portable
Windows can't natively decompress the default *.tar.gz archives.
2016-08-19 12:06:07 +01:00
Cosimo Lupo
0a7c6c22ac README.md: add 'Testing' section 2016-08-19 12:04:08 +01:00
Cosimo Lupo
ac7fca7141 remove 'run-tests.sh' as unnecessary; just run tox or py.test
To run tox on specific versions of python, you can use the -e option:
$ tox -e py27
$ tox -e py35

To only run tests which match the given substring expression, use
py.test -k option. Do `py.test -h` for more info.
2016-08-19 11:38:58 +01:00
Cosimo Lupo
6d02c79557 tox.ini: add {posargs} to pass additional command line arguments to py.test
When invoking the tox command, the arguments after the -- will be passed on to the py.test command:

For example:
$ tox -- -x -s -k 'test_something or test_other'

http://tox.readthedocs.io/en/1.0/example/general.html#interactively-passing-positional-arguments
2016-08-19 11:36:39 +01:00
Cosimo Lupo
c289580089 tox.ini: only include py27 and py35 in default 'envlist''
When running `tox` command without specifying any `-e` option, or when no $TOXENV environment variable is specified, the 'envlist' in tox.ini file determines the list of environment tox will operate on.

http://tox.readthedocs.io/en/latest/config.html#confval-envlist=CSV

I chose Python 2.7 and 3.5 because I assume they are the versions that other fonttols developers run their tests on locally, before pushing and let the CI run the tests on the rest of the pythons.
2016-08-19 11:31:07 +01:00
Cosimo Lupo
a368849243 remove Makefile, as it's pretty useless 2016-08-19 11:17:59 +01:00
Cosimo Lupo
c1f4fff307 remove 'MetaTools/buildChangeLog.py'; hasn't been used in long time, and requires some obscure PHP script 'git2cl' 2016-08-19 11:12:02 +01:00
Cosimo Lupo
1908363d56 Remove 'Tools' folder containing shell scripts; we now use setuptools generated console scripts that work on all platforms, not just Unix 2016-08-19 11:08:37 +01:00
Cosimo Lupo
74ce51c881 MANIFEST.in: don't include missing 'Doc/ChangeLog' file 2016-08-19 11:06:50 +01:00
Cosimo Lupo
374624c356 MANIFEST.in: remove no longer existing files from sdist to avoid displaying warnings when creating sdist 2016-08-19 10:55:57 +01:00
Cosimo Lupo
e6a7e3c53c setup.py: use setuptools.find_packages instead of specifying list of sub-packages 2016-08-19 10:16:18 +01:00
Cosimo Lupo
94b7cac969 setup.py: drop support for distutils-only setup; require setuptools
It's 2016.
2016-08-19 10:14:01 +01:00
Cosimo Lupo
3d8044ab92 travis: install latest python versions 3.4.5, 3.5.2 and pypy-5.3.1
remove unused py33 case
2016-08-19 10:04:39 +01:00
Cosimo Lupo
855c3b17c9 [woff2_test] adjust 'test_incorrect_compressed_size' to make it work with brotlipy
In the upstream google/brotli, if the `decompress` function receives an empty byte
string, it returns a brotli.error; whereas in 'brotlipy' it does not raise but
returns an empty string b"":
https://github.com/python-hyper/brotlipy/issues/43#issuecomment-240378257

This test case asserts that when 'totalCompressedSize' in the WOFF2 header is
incorrectly set, the woff2 reader fails -- either because the brotli decoder
raises an exception, or it returns a string whose length is not the one expected.
2016-08-17 12:07:02 +01:00
Cosimo Lupo
3ddc1f2fee .appveyor.yml: update job labels to match Appveyor installed python versions 2016-08-15 13:10:23 +01:00
Cosimo Lupo
793827e7c6 Appveyor: don't configure environment for C++ compiler as we now use pre-compiled Brotli wheels 2016-08-15 13:10:13 +01:00
Behdad Esfahbod
8701fedcfe More solveCubic() hardening
It really should be quite solid this time. :-)
2016-08-13 16:29:49 -07:00
Behdad Esfahbod
5bea5f4fd6 Remove unused line 2016-08-13 16:25:09 -07:00