fonttools / skia-pathops

Python bindings for the Skia library's Path Ops
https://skia.org/docs/dev/present/pathops/
BSD 3-Clause "New" or "Revised" License
47 stars 14 forks source link

Add INSTALL.md file (or Install section to README) #17

Closed davelab6 closed 6 years ago

davelab6 commented 6 years ago
$ python3 setup.py install
error: the required Cython >= 0.28.4 was not found

etc :)

anthrotype commented 6 years ago

In general, usepip install . to install from a local source checkout. setup.py install is deprecated (uses the old easy_install command from setuptools and creates an egg, wheres pip creates a wheel). If it still fails upgrade pip and try again. Recent pip will bootstrap the build requirements including cython itself. If you can’t or don’t want to upgrade pip you can install cython separately before running install

anthrotype commented 6 years ago

Also

pip install skia-pathops

Should be enough as install instructions. You should get a precompiled wheel as released from pypi (which does not require cython or a C compiler). If you don’t get the wheel and it attempts instead to compile from source, it means you are using a python version or platform which I didn’t build wheels for (which one is that?).

For anything more than pip install skia-pathops, I would simply link to the python packaging user guide for more advanced options

anthrotype commented 6 years ago

I can always have the CI build more wheels of course

davelab6 commented 6 years ago
$ pip3 install .
Processing /Users/dcrossland/src/github.com/fonttools/skia-pathops
  Could not find a version that satisfies the requirement mingwpy>=0.1.0b3 (from versions: )
No matching distribution found for mingwpy>=0.1.0b3
$
davelab6 commented 6 years ago

pip3 install skia-pathops worked tho

anthrotype commented 6 years ago

As i said, if you upgrade pip to latest version (18) then it will work for source checkout too

davelab6 commented 6 years ago

Still not quite working:

$ pip3 install --upgrade pip
Requirement already up-to-date: pip in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (18.0)

$ pip3 install -e .
Obtaining file:///Users/dcrossland/src/github.com/fonttools/skia-pathops
  Installing build dependencies ... done
Installing collected packages: skia-pathops
  Found existing installation: skia-pathops 0.2.0.post2
    Uninstalling skia-pathops-0.2.0.post2:
      Successfully uninstalled skia-pathops-0.2.0.post2
  Running setup.py develop for skia-pathops
    Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -c "import setuptools, tokenize;__file__='/Users/dcrossland/src/github.com/fonttools/skia-pathops/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps:
    running develop
    running egg_info
    writing src/python/skia_pathops.egg-info/PKG-INFO
    writing dependency_links to src/python/skia_pathops.egg-info/dependency_links.txt
    writing requirements to src/python/skia_pathops.egg-info/requires.txt
    writing top-level names to src/python/skia_pathops.egg-info/top_level.txt
    src/python/pathops/_pathops.pyx: cannot find cimported module '._skia.pathops'
    src/python/pathops/_pathops.pyx: cannot find cimported module '._skia.core'
    src/python/pathops/_pathops.pxd: cannot find cimported module '._skia.pathops'
    src/python/pathops/_pathops.pxd: cannot find cimported module '._skia.core'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'src/cpp/skia/README'
    warning: no files found matching 'src/cpp/skia/LICENSE'
    warning: no files found matching '*.cpp' under directory 'src/cpp/skia/src'
    warning: no files found matching '*.h' under directory 'src/cpp/skia/src'
    warning: no files found matching '*.h' under directory 'src/cpp/skia/include'
    writing manifest file 'src/python/skia_pathops.egg-info/SOURCES.txt'
    running build_ext
    running build_clib
    error: file '/Users/dcrossland/src/github.com/fonttools/skia-pathops/src/cpp/skia/src/core/SkArenaAlloc.cpp' does not exist

    ----------------------------------------
  Rolling back uninstall of skia-pathops
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -c "import setuptools, tokenize;__file__='/Users/dcrossland/src/github.com/fonttools/skia-pathops/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" develop --no-deps" failed with error code 1 in /Users/dcrossland/src/github.com/fonttools/skia-pathops/
anthrotype commented 6 years ago

Great, that's a :bug: I'll fix it, thanks!

anthrotype commented 6 years ago

oh... no it's not a bug. You have to either

git clone --recursive https://github.com/fonttools/skia-pathops

Or alternatively, if you have cloned normally without --recursive, you can

git submodule update --init --recursive

Skia library is embedded as a git submodule in the fonttools/skia-pathops repository.