Skip to content

Commit

Permalink
Update compilation procedure
Browse files Browse the repository at this point in the history
Running setup.py directly is deprecated:

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See pypa/setuptools#917 for details.
        ********************************************************************************
  • Loading branch information
gonzaponte committed Dec 18, 2024
1 parent 782b7f5 commit 607d506
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function download_test_db {
}

function compile_cython_components {
python setup.py develop
pip3 install -e .
}

function compile_and_test {
Expand Down
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[project]
name = "invisible_cities"
version = "0.1.0"
description = "NEXT blah blah"
license = {text = "TODO"}

[build-system]
requires = [ "setuptools>=75"
, "cython>=3.0"
, "numpy>=2.1"
, "wheel"
]

build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["invisible_cities"]
15 changes: 12 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,27 @@
from os import path
from subprocess import check_output
import numpy

numpy_include = path.join(path.dirname(numpy.__file__), 'core/include')


version = ( check_output('git describe --tags --always'.split())
.decode()
.split("-")[0]
.removeprefix("v")
)

files = "invisible_cities/*/*.pyx"
directives = dict(language_level=3, embedsignature=True)

setup(name = 'invisible cities',
version = check_output('git describe --tags --always'.split()).decode(),
version = version,
description = 'NEXT blah blah',
url = 'https://github.com/nextic/IC',
author = 'NEXT collaboration',
author_email = 'nextic@TODO.org',
license = 'TODO',
packages = ['invisible_cities'],
ext_modules = cythonize('invisible_cities**/*.pyx'),
include_dirs = [numpy_include],
ext_modules = cythonize(files, compiler_directives=directives),
include_dirs = [numpy.get_include()]
)

0 comments on commit 607d506

Please sign in to comment.