Skip to content

Commit b7c2ed5

Browse files
committed
Changes build-system to hatch
1 parent 60d6bf3 commit b7c2ed5

5 files changed

Lines changed: 37 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v4
20+
uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
2323
- name: Install dependencies
2424
run: |
2525
python -m pip install --upgrade pip
26-
pip install -e .
26+
pip install -e .[test]
2727
- name: Lint with ruff
2828
run: |
2929
pip install ruff
@@ -33,9 +33,7 @@ jobs:
3333
ruff --format=github --target-version=py38 .
3434
continue-on-error: true
3535
- name: Test with pytest
36-
run: |
37-
pip install pytest pytest-cov
38-
pytest tests --doctest-modules --junitxml=reports/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=com --cov-report=xml --cov-report=html
36+
run: pytest tests --doctest-modules --junitxml=reports/test-results-${{ matrix.os }}-${{ matrix.python-version }}.xml --cov=com --cov-report=xml --cov-report=html
3937
- name: Upload test results
4038
uses: actions/upload-artifact@v4
4139
with:

pyproject.toml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[build-system]
2-
requires = ["setuptools>=61.0"]
3-
build-backend = "setuptools.build_meta"
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
44

55
[project]
66
name = "BTensor"
7-
version = "1.1.2"
87
authors = [
98
{ name="Max Nusspickel", email="max.nusspickel@gmail.com" },
109
]
@@ -20,23 +19,20 @@ classifiers = [
2019
"License :: OSI Approved :: Apache Software License",
2120
"Operating System :: OS Independent",
2221
]
22+
dynamic = ["version"]
2323
dependencies = [
24-
"numpy>=1.19.0",
25-
"scipy>=1.1.0",
24+
"numpy",
25+
"scipy",
2626
]
2727

28+
[project.optional-dependencies]
29+
test = ["pytest", "pytest-cov"]
30+
2831
[project.urls]
2932
source = "https://github.com/maxnus/btensor"
3033

31-
[tools.setuptools]
32-
package-dir = {"" = "src"}
33-
license-files = ["LICENSE"]
34-
35-
[tool.setuptools.packages.find]
36-
where = ["src"]
37-
38-
[tools.setuptools.dynamic]
39-
version = {attr = "btensor.__version__"}
34+
[tool.hatch.version]
35+
path = "src/btensor/__about__.py"
4036

4137
[tool.pytest.ini_options]
4238
addopts = ["--import-mode=importlib"]

requirements.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
colorama==0.4.6
2+
coverage==7.8.0
3+
iniconfig==2.1.0
4+
numpy==2.2.5
5+
packaging==25.0
6+
pluggy==1.6.0
7+
pytest==8.3.5
8+
pytest-cov==6.1.1
9+
scipy==1.15.3

src/btensor/__about__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2023 Max Nusspickel
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
__version__ = '1.1.2'

src/btensor/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = '1.1.2'
16-
1715
from .basis import IBasis, Basis, nobasis
1816
from .space import Space
1917
from .tensor import Tensor, Cotensor

0 commit comments

Comments
 (0)