Skip to content

Commit

Permalink
Merge pull request #3 from lab-cosmo/skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
PicoCentauri authored Nov 29, 2023
2 parents 8937336 + b132499 commit fbdffd5
Show file tree
Hide file tree
Showing 29 changed files with 73 additions and 214 deletions.
15 changes: 13 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
include pyproject.toml
graft src

include LICENSE
include VERSION
include README.md

prune docs
prune tests
prune .github
prune .tox

exclude .gitignore
exclude tox.ini

global-exclude *.py[cod] __pycache__/* *.so *.dylib
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions bin/eval-metatensor-model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("eval")
1 change: 1 addition & 0 deletions bin/export-metatensor-model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("export")
1 change: 1 addition & 0 deletions bin/train-metatensor-model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("train")
Empty file.
1 change: 0 additions & 1 deletion metatensor_models/kernel/example/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions metatensor_models/kernel/example/example.py

This file was deleted.

Empty file.
31 changes: 0 additions & 31 deletions metatensor_models/kernel/kernel.py

This file was deleted.

Empty file.
1 change: 0 additions & 1 deletion metatensor_models/linear/example/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions metatensor_models/linear/example/example.py

This file was deleted.

Empty file.
31 changes: 0 additions & 31 deletions metatensor_models/linear/linear.py

This file was deleted.

Empty file removed metatensor_models/nn/__init__.py
Empty file.
1 change: 0 additions & 1 deletion metatensor_models/nn/example/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions metatensor_models/nn/example/example.py

This file was deleted.

Empty file.
23 changes: 0 additions & 23 deletions metatensor_models/nn/nn.py

This file was deleted.

38 changes: 35 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "metatensor-models"
name = "metatensor_models"
dynamic = ["version"]
requires-python = ">=3.7"

Expand All @@ -11,6 +11,7 @@ authors = [
]

dependencies = [
"ase",
"torch",
"metatensor-core",
"metatensor-torch"
Expand Down Expand Up @@ -40,15 +41,46 @@ classifiers = [
repository = "https://github.com/lab-cosmo/metatensor-models"
# changelog = "TODO"

[project.scripts]
maicos = "maicos.__main__:main"

### ======================================================================== ###

[build-system]
requires = [
"setuptools >=68",
"setuptools >= 68",
"wheel",
]
build-backend = "setuptools.build_meta"

### ======================================================================== ###
[project.optional-dependencies]
soap-bpnn = [
"rascaline-torch @ git+https://github.com/luthaf/rascaline#subdirectory=python/rascaline-torch",
]

[tool.setuptools.packages.find]
where = ["src", "bin"]

[tool.setuptools.dynamic]
version = {attr = "metatensor_models.__version__"}

[tool.coverage.report]
include = [
"src/metatensor_models/*"
]

[tool.coverage.xml]
output = 'tests/coverage.xml'

[tool.pytest.ini_options]
python_files = ["*.py"]
testpaths = ["tests"]

[tool.isort]
skip = "__init__.py"
profile = "black"
line_length = 88
indent = 4
include_trailing_comma = true
lines_after_imports = 2
known_first_party = "metatensor_models"
12 changes: 0 additions & 12 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions src/metatensor_models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.0-dev"
5 changes: 5 additions & 0 deletions tests/init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import metatensor_models


def test_version_exists():
metatensor_models.__version__
18 changes: 0 additions & 18 deletions tests/test_kernel.py

This file was deleted.

18 changes: 0 additions & 18 deletions tests/test_linear.py

This file was deleted.

18 changes: 0 additions & 18 deletions tests/test_nn.py

This file was deleted.

22 changes: 16 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ min_version = 4.0
# execute `tox` in the command-line without anything else
envlist =
lint
python-tests
build
tests

[testenv]
passenv = *
lint_folders = "{toxinidir}/metatensor_models" "{toxinidir}/setup.py"
lint_folders = "{toxinidir}/src"

[testenv:lint]
# this environement lints the Python code with flake8 (code linter), black (code
Expand Down Expand Up @@ -41,34 +42,43 @@ commands =
black {[testenv]lint_folders}
blackdoc {[testenv]lint_folders}

[testenv:python-tests]
[testenv:tests]
description = Run basic package tests with pytest (not the architectures)
passenv = *
deps =
pytest

commands =
pytest --import-mode=append {posargs}

[testenv:soap-bpnn]
passenv = *
deps =
pytest

commands =
echo "success"

[testenv:build-python]
# this environement makes sure one can build sdist and wheels for Python
deps =
setuptools
wheel
cmake
twine
build

allowlist_externals =
bash

commands =
# check building sdist and wheels from a checkout
python setup.py sdist
python setup.py bdist_wheel
python -m build
twine check dist/*.tar.gz
twine check dist/*.whl

# check building wheels from the sdist
bash -c "python -m pip wheel --verbose dist/metatensor-models-*.tar.gz -w dist/test"
bash -c "python -m pip wheel --verbose dist/metatensor_models-*.tar.gz -w dist/test"

[flake8]
# longer lines for compatibility with other linters
Expand Down

0 comments on commit fbdffd5

Please sign in to comment.