Add minimal pyproject.toml (#2804)

* Add minimal pyproject.toml

* Update README for Python compile and install

* Remove duplicate meta

* Fix pixel saturation in interpolate_quadratic (#2806)

* Fix pixel saturation in interpolate_quadratic

* Use pixel_type_t alias

* cleanup

---------

Co-authored-by: Adrià Arrufat <1671644+arrufat@users.noreply.github.com>
Co-authored-by: Davis King <davis@dlib.net>
pull/2811/head
Rover van der Noort 1 year ago committed by GitHub
parent 759170d3d6
commit bebba4ca98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
.gitignore vendored

@ -17,3 +17,4 @@ docs/docs/python/classes.txt
docs/docs/python/functions.txt
docs/docs/python/constants.txt
**/.vscode
**/venv

@ -37,12 +37,22 @@ vcpkg install dlib
## Compiling dlib Python API
Before you can run the Python example programs you must compile dlib. Type:
Before you can run the Python example programs you must install the build requirement.
```bash
python -m venv venv
pip install build
```
Then you must compile dlib and install it in your environment. Type:
```bash
python setup.py install
python -m build --wheel
pip install dist/dlib-<version>.whl
```
Or download dlib using PyPi:
```bash
pip install dlib
```
## Running the unit test suite

@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "cmake"]
build-backend = "setuptools.build_meta"

@ -6,14 +6,10 @@ This file basically just uses CMake to compile the dlib python bindings project
located in the tools/python folder and then puts the outputs into standard
python packages.
To build the dlib:
To build dlib:
python setup.py build
To build and install:
python setup.py install
To package the wheel (after pip installing twine and wheel):
python setup.py bdist_wheel
To upload the binary wheel to PyPi
twine upload dist/*.whl
To upload the source distribution to PyPi
python setup.py sdist
twine upload dist/dlib-*.tar.gz
@ -39,7 +35,7 @@ import multiprocessing
from distutils import log
from math import ceil,floor
from setuptools import setup, Extension
from setuptools import find_packages, setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion
@ -234,7 +230,7 @@ setup(
# We need an older more-itertools version because v6 broke pytest (for everyone, not just dlib)
tests_require=['pytest==3.8', 'more-itertools<6.0.0'],
#install_requires=['cmake'], # removed because the pip cmake package is busted, maybe someday it will be usable.
packages=['dlib'],
packages=find_packages(exclude=['python_examples']),
package_dir={'': 'tools/python'},
keywords=['dlib', 'Computer Vision', 'Machine Learning'],
classifiers=[
@ -248,13 +244,6 @@ setup(
'Operating System :: Microsoft :: Windows',
'Programming Language :: C++',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Scientific/Engineering :: Image Recognition',

Loading…
Cancel
Save