"docs/assets/vscode:/vscode.git/clone" did not exist on "7ae8f8bc9bea78659d9552a30d5525aba02093c5"
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. ...@@ -16,7 +16,9 @@ and provide a link to this repository as a footnote or a citation.
Installation 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 pip install git+https://github.com/lucasb-eyer/pydensecrf.git
...@@ -235,3 +237,18 @@ Common Problems ...@@ -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). 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 # coding: UTF-8
from distutils.core import setup from setuptools import setup
from Cython.Build import cythonize
# TODO: # TODO:
# - Wrap learning. # - Wrap learning.
# - Make LabelCompatibility, UnaryEnergy, PairwisePotential extensible? (Maybe overkill?) # - 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( setup(
name="pydensecrf", name="pydensecrf",
version="0.1", version="1.0rc2",
description="A python interface to Philipp Krähenbühl's fully-connected CRF code.", 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="Lucas Beyer",
author_email="lucasb.eyer.be@gmail.com", author_email="lucasb.eyer.be@gmail.com",
url="http://github.com/lucasb-eyer/pydensecrf", url="http://github.com/lucasb-eyer/pydensecrf",
ext_modules=cythonize(['pydensecrf/eigen.pyx', 'pydensecrf/densecrf.pyx']), ext_modules=ext_modules,
packages=["pydensecrf"] 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