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

Create setup.py to enable pip packaging/installation #3

Closed
davelab6 opened this issue Oct 11, 2017 · 14 comments · May be fixed by #438
Closed

Create setup.py to enable pip packaging/installation #3

davelab6 opened this issue Oct 11, 2017 · 14 comments · May be fixed by #438

Comments

@davelab6
Copy link
Member

davelab6 commented Oct 11, 2017

Would be good to have a setup.py script, so we could install this repo's tools via pip

@felipesanches
Copy link
Member

Among the things I think would be in a pip package are:

  • the python scripts that are currently spread on the root directory of this repo:

screenshot at 2017-10-13 19 52 40

  • The code in the util folder:

screenshot at 2017-10-13 19 53 28

screenshot at 2017-10-13 19 54 47

  • possibly more of the *.nam files that are spread on the encodings directory and its subdirectories.

@felipesanches
Copy link
Member

The protobuffer generated file fonts_public_pb2.py in this repo is redundantly kept at the FontBakery repo as well.

@felipesanches
Copy link
Member

I'd chmod a+x all the python scripts.

I would also consider if they can be included as modules on other python code when needed or if they are only useful as standalone scripts. I have to look more carefully at that yet, though.

@felipesanches
Copy link
Member

In other words, packaging means we should come up with a good description of which tools the package provides, if they're meant for stand-alone usage on the command-line or as modules for other python programs, etc.

Right now this repo is a bit messy which seems to be a side-effect of how it grew organically in the past as demands for new helper scripts showed up. Not much different from the current state of the FontBakery helper scripts, actually.

@felipesanches
Copy link
Member

I'll start by creating a setup.py for packaging the fontbakery helper/hotfix scripts that will be merged into this "tools" repo: fonttools/fontbakery#1639

After that, we'll add the scripts from this repo to that setup.py as well.

I suggest that we push this python package to PyPI under the name gftools (which stands for "Google Fonts Tools").

felipesanches added a commit to felipesanches/tools that referenced this issue Oct 31, 2017
Font Bakery from now on will be focused on a sigle purpose:
a Quality-Assurance automated testing framework for font families.
(issue googlefonts#3 and fonttools/fontbakery#1639)
felipesanches added a commit to felipesanches/tools that referenced this issue Nov 2, 2017
Font Bakery from now on will be focused on a sigle purpose:
a Quality-Assurance automated testing framework for font families.
(issue googlefonts#3 and fonttools/fontbakery#1639)
felipesanches added a commit to felipesanches/tools that referenced this issue Nov 2, 2017
avoid having to inport the whole of fontbakery as a dependency
This is very minimal so I think it is acceptable.
(issue googlefonts#3)
felipesanches added a commit to felipesanches/tools that referenced this issue Nov 2, 2017
felipesanches added a commit to felipesanches/tools that referenced this issue Nov 2, 2017
(the ones that came from fontbakery). And also updated dependencies on setup.py
(issue googlefonts#3)
felipesanches added a commit to felipesanches/tools that referenced this issue Nov 2, 2017
felipesanches added a commit to felipesanches/tools that referenced this issue Nov 4, 2017
felipesanches added a commit that referenced this issue Nov 4, 2017
Font Bakery from now on will be focused on a sigle purpose:
a Quality-Assurance automated testing framework for font families.
(issue #3 and fonttools/fontbakery#1639)
felipesanches added a commit that referenced this issue Nov 4, 2017
avoid having to inport the whole of fontbakery as a dependency
This is very minimal so I think it is acceptable.
(issue #3)
felipesanches added a commit that referenced this issue Nov 4, 2017
(the ones that came from fontbakery). And also updated dependencies on setup.py
(issue #3)
felipesanches added a commit that referenced this issue Nov 4, 2017
@felipesanches
Copy link
Member

done.

A first release built with this is available now for testing at https://pypi.python.org/pypi/gftools/0.1.0

@davelab6
Copy link
Member Author

davelab6 commented Nov 5, 2017

Seems to install nicely:

$ sudo  /usr/local/Cellar/python/2.7.12/bin/pip2   install gftools
Collecting gftools
  Downloading gftools-0.1.0-py2-none-any.whl (97kB)
    100% |████████████████████████████████| 102kB 2.3MB/s 
Requirement already satisfied: unidecode in /usr/local/lib/python2.7/site-packages (from gftools)
Collecting Flask (from gftools)
  Downloading Flask-0.12.2-py2.py3-none-any.whl (83kB)
    100% |████████████████████████████████| 92kB 6.1MB/s 
Requirement already satisfied: protobuf in ./dcrossland/Library/Python/2.7/lib/python/site-packages (from gftools)
Requirement already satisfied: glyphsLib in /usr/local/lib/python2.7/site-packages (from gftools)
Requirement already satisfied: FontTools in ./dcrossland/Library/Python/2.7/lib/python/site-packages/FontTools (from gftools)
Requirement already satisfied: tabulate in /usr/local/lib/python2.7/site-packages (from gftools)
Requirement already satisfied: requests in /usr/local/lib/python2.7/site-packages (from gftools)
Collecting pillow (from gftools)
  Downloading Pillow-4.3.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (3.5MB)
    100% |████████████████████████████████| 3.6MB 406kB/s 
Requirement already satisfied: google-apputils in ./dcrossland/Library/Python/2.7/lib/python/site-packages (from gftools)
Collecting itsdangerous>=0.21 (from Flask->gftools)
  Downloading itsdangerous-0.24.tar.gz (46kB)
    100% |████████████████████████████████| 51kB 8.5MB/s 
Collecting Werkzeug>=0.7 (from Flask->gftools)
  Downloading Werkzeug-0.12.2-py2.py3-none-any.whl (312kB)
    100% |████████████████████████████████| 317kB 4.2MB/s 
Requirement already satisfied: Jinja2>=2.4 in ./dcrossland/Library/Python/2.7/lib/python/site-packages (from Flask->gftools)
Collecting click>=2.0 (from Flask->gftools)
  Downloading click-6.7-py2.py3-none-any.whl (71kB)
    100% |████████████████████████████████| 71kB 9.0MB/s 
Requirement already satisfied: six>=1.9 in ./dcrossland/Library/Python/2.7/lib/python/site-packages (from protobuf->gftools)
Requirement already satisfied: setuptools in ./dcrossland/Library/Python/2.7/lib/python/site-packages (from protobuf->gftools)
Requirement already satisfied: MutatorMath>=2.0.0 in /usr/local/lib/python2.7/site-packages (from glyphsLib->gftools)
Requirement already satisfied: defcon>=0.2.0 in /usr/local/lib/python2.7/site-packages (from glyphsLib->gftools)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python2.7/site-packages (from requests->gftools)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python2.7/site-packages (from requests->gftools)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/site-packages (from requests->gftools)
Collecting olefile (from pillow->gftools)
  Downloading olefile-0.44.zip (74kB)
    100% |████████████████████████████████| 81kB 9.4MB/s 
Requirement already satisfied: python-dateutil>=1.4 in ./dcrossland/Library/Python/2.7/lib/python/site-packages (from google-apputils->gftools)
Requirement already satisfied: python-gflags>=1.4 in ./dcrossland/Library/Python/2.7/lib/python/site-packages (from google-apputils->gftools)
Requirement already satisfied: pytz>=2010 in ./dcrossland/Library/Python/2.7/lib/python/site-packages (from google-apputils->gftools)
Requirement already satisfied: MarkupSafe in ./dcrossland/Library/Python/2.7/lib/python/site-packages (from Jinja2>=2.4->Flask->gftools)
Requirement already satisfied: ufoLib>=2.0.0 in /usr/local/lib/python2.7/site-packages (from MutatorMath>=2.0.0->glyphsLib->gftools)
Requirement already satisfied: fontMath>=0.4.1 in /usr/local/lib/python2.7/site-packages (from MutatorMath>=2.0.0->glyphsLib->gftools)
Building wheels for collected packages: itsdangerous, olefile
  Running setup.py bdist_wheel for itsdangerous ... done
  Stored in directory: /Users/dcrossland/Library/Caches/pip/wheels/fc/a8/66/24d655233c757e178d45dea2de22a04c6d92766abfb741129a
  Running setup.py bdist_wheel for olefile ... done
  Stored in directory: /Users/dcrossland/Library/Caches/pip/wheels/20/58/49/cc7bd00345397059149a10b0259ef38b867935ea2ecff99a9b
Successfully built itsdangerous olefile
Installing collected packages: itsdangerous, Werkzeug, click, Flask, olefile, pillow, gftools
Collecting google-apputils (from gftools)
  Downloading google-apputils-0.4.2.zip (101kB)
    100% |████████████████████████████████| 102kB 1.4MB/s 
Requirement already satisfied: itsdangerous>=0.21 in /usr/local/lib/python2.7/site-packages (from Flask->gftools)
Requirement already satisfied: Werkzeug>=0.7 in /usr/local/lib/python2.7/site-packages (from Flask->gftools)
Collecting Jinja2>=2.4 (from Flask->gftools)
  Downloading Jinja2-2.9.6-py2.py3-none-any.whl (340kB)
    100% |████████████████████████████████| 348kB 5.5MB/s 
Requirement already satisfied: click>=2.0 in /usr/local/lib/python2.7/site-packages (from Flask->gftools)
Requirement already satisfied: six>=1.9 in /usr/local/lib/python2.7/site-packages (from protobuf->gftools)
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages (from protobuf->gftools)
Requirement already satisfied: MutatorMath>=2.0.0 in /usr/local/lib/python2.7/site-packages (from glyphsLib->gftools)
Requirement already satisfied: defcon>=0.2.0 in /usr/local/lib/python2.7/site-packages (from glyphsLib->gftools)
Requirement already satisfied: idna<2.7,>=2.5 in /usr/local/lib/python2.7/site-packages (from requests->gftools)
Requirement already satisfied: urllib3<1.23,>=1.21.1 in /usr/local/lib/python2.7/site-packages (from requests->gftools)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/site-packages (from requests->gftools)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/site-packages (from requests->gftools)
Requirement already satisfied: olefile in /usr/local/lib/python2.7/site-packages (from pillow->gftools)
Collecting python-dateutil>=1.4 (from google-apputils->gftools)
  Downloading python_dateutil-2.6.1-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 6.1MB/s 
Collecting python-gflags>=1.4 (from google-apputils->gftools)
  Downloading python-gflags-3.1.2.tar.gz (52kB)
    100% |████████████████████████████████| 61kB 6.9MB/s 
Collecting pytz>=2010 (from google-apputils->gftools)
  Downloading pytz-2017.3-py2.py3-none-any.whl (511kB)
    100% |████████████████████████████████| 512kB 2.7MB/s 
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->Flask->gftools)
  Downloading MarkupSafe-1.0.tar.gz
Requirement already satisfied: ufoLib>=2.0.0 in /usr/local/lib/python2.7/site-packages (from MutatorMath>=2.0.0->glyphsLib->gftools)
Requirement already satisfied: fontMath>=0.4.1 in /usr/local/lib/python2.7/site-packages (from MutatorMath>=2.0.0->glyphsLib->gftools)
Building wheels for collected packages: google-apputils, python-gflags, MarkupSafe
  Running setup.py bdist_wheel for google-apputils ... done
  Stored in directory: /var/root/Library/Caches/pip/wheels/c2/c7/36/083b74a76ab1eeea8ebeb52c0ab118d455caec0607699c0eb8
  Running setup.py bdist_wheel for python-gflags ... done
  Stored in directory: /var/root/Library/Caches/pip/wheels/e8/9e/c1/a54ef14b0aaa051d73277146a27de8addd93a966611a9c4492
  Running setup.py bdist_wheel for MarkupSafe ... done
  Stored in directory: /var/root/Library/Caches/pip/wheels/88/a7/30/e39a54a87bcbe25308fa3ca64e8ddc75d9b3e5afa21ee32d57
Successfully built google-apputils python-gflags MarkupSafe
Installing collected packages: python-dateutil, python-gflags, pytz, google-apputils, MarkupSafe, Jinja2
Successfully installed Jinja2-2.9.6 MarkupSafe-1.0 google-apputils-0.4.2 python-dateutil-2.6.1 python-gflags-3.1.2 pytz-2017.3
$

@davelab6
Copy link
Member Author

davelab6 commented Nov 5, 2017

A small thing, in the tag, you wrote the date as 2017-Nov-04

I request dates formatted YYYY-MM-DD with numbers so they always sort correctly :)

@felipesanches
Copy link
Member

oh! OK. I'll delete the current tag and create a new one.

@felipesanches
Copy link
Member

ok, done :-)

@felipesanches
Copy link
Member

let me know if the scripts work fine

@felipesanches
Copy link
Member

they did work fine for me here when I tested them.

@davelab6
Copy link
Member Author

davelab6 commented Nov 5, 2017

The scripts seem not to be in my path, eg

$ whereis add_font
$

This should return the path, if it exists

@davelab6
Copy link
Member Author

davelab6 commented Nov 5, 2017

Seeing the other issue:

$ gftools
gftools: command not found
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants