Skip to content

Commit

Permalink
Improve/correct python package (#4)
Browse files Browse the repository at this point in the history
* Add ignoring init files into flake8 config file

* Add additional fields into pyproject.toml config file

* Move all python files to own package

* Updated examples after all changes

* Update actions -> change commands for flake8 and pylint

* Update Cargo.toml -> replace local crates to git
  • Loading branch information
breadrock1 authored Aug 30, 2023
1 parent 2058a82 commit 988f02a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ statistics = True

# Provide a comma-separated list of glob patterns to exclude from checks.
exclude =
# init package files
__init__.py,

# .* files
.flake8

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ features = [

[dependencies]
numpy = "0.19.0"
cvlcore = { path = "../CVLCore" }
cvlcore = { git = "ssh://git@github.com/breadrock1/CVLCore.git" }
3 changes: 1 addition & 2 deletions examples/simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from cv2 import error, imshow, waitKey
from numpy import ndarray

from pycvl import PyColorBounds, PyCvlHelper
from queue_list import QueueList
from pycvl import PyColorBounds, PyCvlHelper, QueueList


MAX_QUEUE_SIZE = 10
Expand Down
11 changes: 9 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[project]
name = "pycvl"
version = "0.0.1"
license = "LICENSE"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.7"
keywords = [ "pycvl", "cvlcore", "rust", "opencv" ]
dependencies = [ "numpy>=1.25" ]
authors = [
{ name = "Bread White", email = "breadrock1@gmail.com" },
{ name = "Artem Amentes" , email = "artem@socialcode.ru"},
Expand All @@ -13,5 +15,10 @@ authors = [
homepage = "https://github.com/breadrock1/pycvl"

[build-system]
requires = ["maturin>=0.13,<0.14", "numpy>=1.25"]
requires = ["maturin>=0.13,<0.14"]
build-backend = "maturin"

[tool.maturin]
features = ["pyo3/extension-module"]
python-source = "python"
module-name = "pycvl.pycvl"
2 changes: 2 additions & 0 deletions python/pycvl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from pycvl.pycvl import PyColorBounds, PyCvlHelper
from pycvl.queue_list import QueueList
1 change: 1 addition & 0 deletions pycvl.pyi → python/pycvl/pycvl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class PyCvlHelper:
"""
There is main constructor for current class which provides ability to use CvlCore APIs.
"""
self.a = 0

def median(self, frame: ndarray) -> float:
"""
Expand Down
File renamed without changes.

0 comments on commit 988f02a

Please sign in to comment.