Skip to content

Commit

Permalink
update-lenlp-maturin-build Co-authored-by: AdilZouitine <adilzouitine…
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Sourty committed Jun 1, 2024
1 parent 25806a0 commit 77438d6
Show file tree
Hide file tree
Showing 20 changed files with 90 additions and 66 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "lenlp"
name = "_rslenlp"
edition = "2021"

[lib]
name = "rslenlp"
name = "_rslenlp"
crate-type = ["cdylib"]
path = "rust/lib.rs"

Expand All @@ -23,5 +23,5 @@ opt-level = 0
[profile.release]
opt-level = 3

[tool.setuptools.packages]
find = { where = ["lenlp"] }
[tool.maturin]
features = ["pyo3/extension-module"]
2 changes: 0 additions & 2 deletions Manifest.in

This file was deleted.

78 changes: 78 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
[build-system]
requires = ["maturin >= 1.5.1"]
build-backend = "maturin"

[project]
name = "lenlp"
version = "1.0.5"
description = "Natural Language Processing library for Python from Rust."

authors = [
{name = "Raphael Sourty", email = "[email protected]"},
]


keywords = []

classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Rust",
"Operating System :: OS Independent",
]

requires-python = ">=3.8"

dependencies = [
"scikit-learn >= 1.5.0",
"scipy >= 1.13.1",
]

[project.urls]
Homepage = "https://github.com/raphaelsty/lenlp"
Documentation = "https://github.com/raphaelsty/lenlp"
Repository = "https://github.com/raphaelsty/lenlp"

[project.optional-dependencies]
dev = [
"maturin >= 1.5.1",
"pytest-cov >= 5.0.0",
"pytest >= 7.4.4",
"ruff >= 0.1.15",
]
[tool.maturin]
bindings = "pyo3"
features = ["pyo3/extension-module"]
python-source = "python"
module-name = "lenlp._rslenlp"

[tool.include]
include = [
"Cargo.toml",
"pyproject.toml",
"README.md",
"rust/*",
]

[tool.pytest.ini_options]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::RuntimeWarning",
"ignore::UserWarning",
]
addopts = [
"--doctest-modules",
"--verbose",
"-ra",
"--cov-config=.coveragerc",
"-m not web and not slow",
]
doctest_optionflags = ["NORMALIZE_WHITESPACE", "NUMBER"]
norecursedirs = [
"build",
"docs",
"node_modules",
]
markers = [
"web: tests that require using the Internet",
"slow: tests that take a long time to run",
]
19 changes: 0 additions & 19 deletions pytest.ini

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion lenlp/__version__.py → python/lenlp/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (1, 0, 5)
VERSION = (1, 0, 6)

__version__ = ".".join(map(str, VERSION))
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from rslenlp import rschar_ngrams_many, rschar_wb_ngrams_many, rssplit_words_many
from lenlp._rslenlp import rschar_ngrams_many, rschar_wb_ngrams_many, rssplit_words_many

__all__ = ["analyze"]

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lenlp/counter/count.py → python/lenlp/counter/count.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from rslenlp import (
from lenlp._rslenlp import (
rsvectorize_char_ngrams_many,
rsvectorize_char_wb_ngrams_many,
rsvectorize_split_words_many,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from rslenlp import RSKeywordProcessor
from lenlp._rslenlp import RSKeywordProcessor

__all__ = ["FlashText"]

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from rslenlp import rsnormalize, rsnormalize_many
from lenlp._rslenlp import rsnormalize, rsnormalize_many

__all__ = ["normalize"]

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from rslenlp import SparseMatrixBuilder
from scipy.sparse import csr_matrix

from lenlp._rslenlp import SparseMatrixBuilder

__all__ = ["CountVectorizer"]


Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod rsstop_words;
mod rsvectorizer;

#[pymodule]
fn rslenlp(_py: Python, m: &PyModule) -> PyResult<()> {
fn _rslenlp(_py: Python, m: &PyModule) -> PyResult<()> {
rsanalyzer::register_functions(m)?;
rscounter::register_functions(m)?;
rsflashtext::register_functions(m)?;
Expand Down
34 changes: 0 additions & 34 deletions setup.py

This file was deleted.

0 comments on commit 77438d6

Please sign in to comment.