Skip to content

Commit 9f5cf17

Browse files
committed
fix packaging with proper deps + compilation
1 parent 04a5a1a commit 9f5cf17

7 files changed

Lines changed: 90 additions & 800 deletions

File tree

README_PYPI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
![Pasteur Logo with text. Tagline reads: 'Sanitize Your Data'](https://raw.githubusercontent.com/pasteur-dev/pasteur-web/master/assets/img/logo_text_light.svg)
33

44
Pasteur is a system for data synthesis in a prototype state.
5-
You can install it with `pip install pasteur` but may face issues during use.
65
Head to https://pasteur.dev or https://github.com/pasteur-dev/pasteur for
7-
more information (the source code will be made available in a few days).
6+
more information.
7+
Documentation and project template coming soon!

pyproject.toml

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pasteur"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
authors = [
55
{ name="Kapenekakis Antheas", email="antheas@cs.aau.dk" },
66
]
@@ -13,10 +13,72 @@ classifiers = [
1313
"Operating System :: OS Independent",
1414
]
1515

16+
dependencies = [
17+
# Core
18+
"kedro>=0.18.3",
19+
"mlflow",
20+
"pyarrow",
21+
"tqdm",
22+
# Comp. Libs
23+
"numpy",
24+
"pandas",
25+
"scipy",
26+
"scikit-learn",
27+
]
28+
29+
[project.optional-dependencies]
30+
opt = [
31+
"ipython>=7.31.1",
32+
"jupyter~=1.0",
33+
"jupyterlab~=3.0",
34+
"kedro-viz",
35+
"black~=22.0",
36+
"flake8>=3.7.9, <4.0",
37+
"isort~=5.0",
38+
"parquet-tools",
39+
]
40+
test = [
41+
"pytest-cov~=3.0",
42+
"pytest-mock>=1.7.1, <2.0",
43+
"pytest~=6.2",
44+
]
45+
cls = [
46+
"xgboost"
47+
]
48+
docs = [
49+
"docutils<0.18.0",
50+
"sphinx~=3.4.3",
51+
"sphinx_rtd_theme==0.5.1",
52+
"nbsphinx==0.8.1",
53+
"recommonmark==0.7.1",
54+
"sphinx-autodoc-typehints==1.11.1",
55+
"sphinx_copybutton==0.3.1",
56+
"ipykernel>=5.3, <7.0",
57+
"Jinja2<3.1.0",
58+
]
59+
1660
[project.urls]
1761
"Homepage" = "https://pasteur.dev"
1862
"Bug Tracker" = "https://github.com/pasteur-dev/pasteur/issues"
1963

64+
[project.entry-points."console_scripts"]
65+
pasteur = "pasteur.__main__:main"
66+
67+
[project.entry-points."kedro.hooks"]
68+
pasteur = "pasteur.kedro.hooks:pasteur"
69+
pasteur_mlflow = "pasteur.kedro.hooks:mlflow"
70+
71+
[project.entry-points."kedro.project_commands"]
72+
pasteur = "pasteur.cli:cli"
73+
74+
[build-system]
75+
requires = ["setuptools>=61.0", "wheel", "numpy>=1.15"]
76+
build-backend = "setuptools.build_meta"
77+
78+
[tool.setuptools.packages.find]
79+
where = ["src"] # list of folders that contain the packages (["."] by default)
80+
include = ["pasteur*"] # package names should match these glob patterns (["*"] by default)
81+
2082
[tool.kedro]
2183
package_name = "project"
2284
project_name = "Pasteur Testing Project"
@@ -38,8 +100,4 @@ addopts = """
38100
[tool.coverage.report]
39101
fail_under = 0
40102
show_missing = true
41-
exclude_lines = ["pragma: no cover", "raise NotImplementedError"]
42-
43-
[build-system]
44-
requires = ["setuptools>=61.0", "wheel", "numpy >= 1.15"]
45-
build-backend = "setuptools.build_meta"
103+
exclude_lines = ["pragma: no cover", "raise NotImplementedError"]

requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-e .[opt,test,cls,docs]

setup.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import os
2+
3+
import numpy as np
4+
from setuptools import Extension, setup
5+
6+
7+
def get_c_files(dr: str):
8+
return [
9+
os.path.join(dr, fn)
10+
for fn in os.listdir(dr)
11+
if fn.endswith(".c") or fn.endswith(".h")
12+
]
13+
14+
setup(
15+
ext_modules=[
16+
Extension(
17+
"pasteur.marginal.native",
18+
get_c_files("src/pasteur/marginal/native/"),
19+
include_dirs=[np.get_include()],
20+
extra_compile_args=["-O3", "-march=native"],
21+
)
22+
],
23+
)

0 commit comments

Comments
 (0)