Skip to content

Commit

Permalink
reviewed build system
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvanBrocard committed Oct 25, 2021
1 parent 24cddaa commit 236fe78
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ RUN sudo apt update \
&& sudo apt install -y ./upmem_2021.2.0_amd64.deb \
&& sudo apt install -y pip cmake ninja-build \
&& sudo apt full-upgrade -y \
&& pip install --upgrade nox pre-commit scikit-build pybind11[global] importlib_resources twine
&& pip install --upgrade pip nox pre-commit scikit-build pybind11[global] importlib_resources twine setuptools_scm
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// "postCreateCommand": "uname -a",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode",
"remoteUser": "vscode",

"postCreateCommand": "pre-commit install && python3 setup.py develop && python3 setup.py clean"
"postCreateCommand": "sudo pre-commit install && pip install -e . && python3 setup.py clean"
}
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15...3.19)

project(dpu_trees)
project(dpu_kmeans)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ dpu_trees

| CI | status |
|----------------------|--------|
| conda.recipe | [![Conda Actions Status][actions-conda-badge]][actions-conda-link] |
| pip builds | [![Pip Actions Status][actions-pip-badge]][actions-pip-link] |
| wheel | [![Wheels Actions Status][actions-wheels-badge]][actions-wheels-link] |

A project built with [pybind11](https://github.com/pybind/pybind11) and scikit-build, running DPU programs with the UPMEM SDK.

Expand All @@ -20,6 +18,7 @@ A project built with [pybind11](https://github.com/pybind/pybind11) and scikit-b
Installation
------------

- install the [UPMEM SDK](https://sdk.upmem.com/)
- `pip install dpu-trees`

OR
Expand Down Expand Up @@ -69,5 +68,6 @@ Test call
import dpu_trees
dpu_trees.add(1, 2)
```
Expected return: `0x007f8000`

[`cibuildwheel`]: https://cibuildwheel.readthedocs.io
72 changes: 39 additions & 33 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@

# -- Project information -----------------------------------------------------

project = 'dpu_trees'
copyright = '2021, Sylvan Brocard'
author = 'Sylvan Brocard'
project = "dpu_kmeans"
copyright = "2021, Sylvan Brocard"
author = "Sylvan Brocard"

# The short X.Y version
version = ''
# The full version, including alpha/beta/rc tags
release = '0.0.1'
from importlib.metadata import version

# The full version, including alpha/beta/rc tags
release = version(project)
# The short X.Y version
version = ".".join(release.split(".")[:2])

# -- General configuration ---------------------------------------------------

Expand All @@ -39,26 +40,26 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.githubpages',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.githubpages",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
]

autosummary_generate = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -70,7 +71,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
Expand All @@ -81,7 +82,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = "alabaster"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -92,7 +93,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -108,7 +109,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'dpu_treesdoc'
htmlhelp_basename = "dpu_kmeansdoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -117,15 +118,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -135,19 +133,21 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'dpu_trees.tex', 'dpu\\_trees Documentation',
'Sylvan Brocard', 'manual'),
(
master_doc,
"dpu_kmeans.tex",
"dpu\\_kmeans Documentation",
"Sylvan Brocard",
"manual",
),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'dpu_trees', 'dpu_trees Documentation',
[author], 1)
]
man_pages = [(master_doc, "dpu_kmeans", "dpu_kmeans Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -156,9 +156,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'dpu_trees', 'dpu_trees Documentation',
author, 'dpu_trees', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"dpu_kmeans",
"dpu_kmeans Documentation",
author,
"dpu_kmeans",
"One line description of project.",
"Miscellaneous",
),
]


Expand All @@ -177,9 +183,9 @@
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]


# -- Extension configuration -------------------------------------------------
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}
1 change: 1 addition & 0 deletions docs/dpu_kmeans.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. automodule:: dpu_kmeans
1 change: 0 additions & 1 deletion docs/dpu_trees.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Welcome to dpu_trees's documentation!
:maxdepth: 2
:caption: Contents:

dpu_trees
dpu_kmeans



Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ requires = [
"cmake>=3.21",
"scikit-build>=0.12",
"ninja",
"pkgconfig"
"pkgconfig",
"setuptools_scm>=6.2",
]

build-backend = "setuptools.build_meta"
14 changes: 8 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@

# compilation of the host library
setup(
name="dpu_trees",
version="0.0.4-alpha",
description="a package for tree algorithms on DPU",
name="dpu_kmeans",
use_scm_version={
"root": ".",
"relative_to": __file__,
},
description="a package for the k-means algorithm on DPU",
author="Sylvan Brocard",
author_email="[email protected]",
url="https://github.com/SylvanBrocard/dpu_trees",
download_url="https://github.com/SylvanBrocard/dpu_trees/archive/refs/tags/v0.0.2-alpha.tar.gz",
url="https://github.com/upmem/dpu_kmeans",
license="MIT",
packages=find_packages(where="src"),
package_dir={"": "src"},
cmake_install_dir="src/dpu_trees",
cmake_install_dir="src/dpu_kmeans",
include_package_data=True,
extras_require={
"test": ["pytest"],
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/dpu_trees/base_tree.py → src/dpu_kmeans/base_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@


def test_dpu_bin():
ref = files("dpu_trees").joinpath("dpu_program/helloworld")
ref = files("dpu_kmeans").joinpath("dpu_program/helloworld")
with as_file(ref) as path:
dpu_test(str(path))


def test_checksum():
ref = files("dpu_trees").joinpath("dpu_program/trivial_checksum_example")
ref = files("dpu_kmeans").joinpath("dpu_program/trivial_checksum_example")
with as_file(ref) as path:
return f"{checksum(str(path)):#0{10}x}"
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ namespace py = pybind11;

PYBIND11_MODULE(_core, m) {
m.doc() = R"pbdoc(
DPU trees plugin
----------------
DPU kmeans plugin
-----------------
.. currentmodule:: dpu_trees
.. currentmodule:: dpu_kmeans
.. autosummary::
:toctree: _generate
Expand Down
2 changes: 1 addition & 1 deletion tests/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
import dpu_trees as m
import dpu_kmeans as m


def test_add():
Expand Down

0 comments on commit 236fe78

Please sign in to comment.