"vscode:/vscode.git/clone" did not exist on "d8fe4355fea4cd2496e73e697bbd5049d89ac53b"
Commit e668c4db authored by lucasb-eyer's avatar lucasb-eyer
Browse files

Make it a PyPI package.

parent 327e4118
include pydensecrf/eigen.pxd
include pydensecrf/eigen.pyx
include pydensecrf/densecrf.pxd
include pydensecrf/densecrf.pyx
recursive-include pydensecrf/densecrf *
......@@ -16,7 +16,9 @@ and provide a link to this repository as a footnote or a citation.
Installation
============
You can install this using `pip` by executing:
The package is on PyPI, so simply run `pip install pydensecrf` to install it.
If you want the newest and freshest version, you can install it by executing:
```
pip install git+https://github.com/lucasb-eyer/pydensecrf.git
......@@ -235,3 +237,18 @@ Common Problems
---------------------------------
If while importing pydensecrf you get an error about some undefined symbols (for example `.../pydensecrf/densecrf.so: undefined symbol: _ZTINSt8ios_base7failureB5cxx11E`), you most likely are inadvertently mixing different compilers or toolchains. Try to see what's going on using tools like `ldd`. If you're using Anaconda, [running `conda install libgcc` might be a solution](https://github.com/lucasb-eyer/pydensecrf/issues/28).
Maintaining
===========
These are instructions for maintainers about how to release new versions. (Mainly instructions for myself.)
```
# Go increment the version in setup.py
> python setup.py build_ext
> python setup.py sdist
> twine upload dist/pydensecrf-VERSION_NUM.tar.gz
```
And that's it. At some point, it would be cool to automate this on [TravisCI](https://docs.travis-ci.com/user/deployment/pypi/), but not worth it yet.
At that point, looking into [creating "manylinux" wheels](https://github.com/pypa/python-manylinux-demo) might be nice, too.
# coding: UTF-8
from distutils.core import setup
from Cython.Build import cythonize
from setuptools import setup
# TODO:
# - Wrap learning.
# - Make LabelCompatibility, UnaryEnergy, PairwisePotential extensible? (Maybe overkill?)
# If Cython is available, build using Cython.
# Otherwise, use the pre-built (by someone who has Cython, i.e. me) wrapper `.cpp` files.
try:
from Cython.Build import cythonize
ext_modules = cythonize(['pydensecrf/eigen.pyx', 'pydensecrf/densecrf.pyx'])
except ImportError:
from setuptools.extension import Extension
ext_modules = [
Extension("pydensecrf/eigen", ["pydensecrf/eigen.cpp", "pydensecrf/eigen_impl.cpp"], language="c++", include_dirs=["pydensecrf/densecrf/include"]),
Extension("pydensecrf/densecrf", ["pydensecrf/densecrf.cpp", "pydensecrf/densecrf/src/densecrf.cpp", "pydensecrf/densecrf/src/unary.cpp", "pydensecrf/densecrf/src/pairwise.cpp", "pydensecrf/densecrf/src/permutohedral.cpp", "pydensecrf/densecrf/src/optimization.cpp", "pydensecrf/densecrf/src/objective.cpp", "pydensecrf/densecrf/src/labelcompatibility.cpp", "pydensecrf/densecrf/src/util.cpp", "pydensecrf/densecrf/external/liblbfgs/lib/lbfgs.c"], language="c++", include_dirs=["pydensecrf/densecrf/include", "pydensecrf/densecrf/external/liblbfgs/include"]),
]
setup(
name="pydensecrf",
version="0.1",
description="A python interface to Philipp Krähenbühl's fully-connected CRF code.",
version="1.0rc2",
description="A python interface to Philipp Krähenbühl's fully-connected (dense) CRF code.",
long_description="See the README.md at http://github.com/lucasb-eyer/pydensecrf",
author="Lucas Beyer",
author_email="lucasb.eyer.be@gmail.com",
url="http://github.com/lucasb-eyer/pydensecrf",
ext_modules=cythonize(['pydensecrf/eigen.pyx', 'pydensecrf/densecrf.pyx']),
packages=["pydensecrf"]
ext_modules=ext_modules,
packages=["pydensecrf"],
setup_requires=['cython>=0.22'],
classifiers=[
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Development Status :: 5 - Production/Stable",
"Programming Language :: C++",
"Programming Language :: Python",
"Operating System :: POSIX :: Linux",
"Topic :: Software Development :: Libraries",
"Topic :: Scientific/Engineering :: Image Recognition",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
],
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment