Skip to content

migrated the package manager and build-backend #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ jobs:
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d

# Cache dependencies from poetry to speed things up
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install and upgrade pip and poetry
run: python -m pip install --upgrade pip poetry
# - name: Load cached venv
# id: cached-poetry-dependencies
# uses: actions/cache@v3
# with:
# path: .venv
# key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install and upgrade pip and uv
run: python -m pip install --upgrade pip uv

- name: Install Dependencies
run: ./bin/task setup
Expand Down
18 changes: 9 additions & 9 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ tasks:
setup:
desc: Setup the development environment.
cmds:
- poetry install
- uv sync

lint:
desc: Lints the code and reports on issues.
cmds:
- poetry run black --check .
- poetry run ruff check .
- uv run black --check .
- uv run ruff check .

build:
desc: Builds the python package
cmds:
- poetry build
- uv build

test:
desc: Runs tests on the code
cmds:
- >
poetry run pytest test
uv run pytest test
--cov=lasso
--cov-report=html

Expand All @@ -31,29 +31,29 @@ tasks:
- test
- docs:changelog
cmds:
- poetry run mkdocs serve
- uv run mkdocs serve

docs:build:
desc: Build the documentation
deps:
- test
- docs:changelog
cmds:
- poetry run mkdocs build
- uv run mkdocs build

docs:deploy:
desc: Deploys the docs to GitHub (be careful!)
deps:
- test
- docs:changelog
cmds:
- poetry run mkdocs gh-deploy
- uv run mkdocs gh-deploy

docs:changelog:
desc: Generates the changelog
cmds:
- >
poetry run git-changelog .
uv run git-changelog .
--output CHANGELOG.md
--style angular
--template angular
2 changes: 1 addition & 1 deletion docs/diffcrash/run.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ easier.
You can get the run info by performing:

```console
$ python -m lasso.diffcrash.run --help
$ diffcrash --help

==== D I F F C R A S H ====

Expand Down
2 changes: 1 addition & 1 deletion docs/dimred/command_line_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ resizeContents()
You can call the command-line tool as follows:

```console
$ python -m lasso.dimred.run --help
$ dimred --help

usage: run.py [-h] --reference-run REFERENCE_RUN
[--exclude-runs [EXCLUDE_RUNS [EXCLUDE_RUNS ...]]]
Expand Down
7 changes: 7 additions & 0 deletions lasso/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = version("lasso-python")
except PackageNotFoundError:
# package is not installed
pass
2 changes: 1 addition & 1 deletion lasso/dimred/graph_laplacian.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _laplacian_gauss_idw(
for i, (j, d, e, k) in enumerate(
zip(
*tree.query_radius(points, return_distance=True, r=search_radius),
*tree.query(points, return_distance=True, k=1 + min_neighbors)
*tree.query(points, return_distance=True, k=1 + min_neighbors),
)
):
# Always search for k neighbors, this prevents strongly connected local areas
Expand Down
1,941 changes: 0 additions & 1,941 deletions poetry.lock

This file was deleted.

72 changes: 41 additions & 31 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[tool.poetry]
[project]
name = "lasso-python"
version = "2.0.3"
description = "An open-source CAE and Machine Learning library."
authors = ["open-lasso-python <[email protected]>"]
license = "BSD-3"
license-files = ["LICENSE.md"]
readme = "README.rst"
dynamic = ["version"]
authors = [{ name = "open-lasso-python", email = "[email protected]" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Topic :: Scientific/Engineering",
Expand All @@ -12,43 +13,52 @@ classifiers = [
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
packages = [
{ include = "lasso" }

requires-python = ">=3.9"
dependencies = [
"h5py==3.*",
"scipy==1.*",
"numpy==1.*",
"plotly==5.*",
# "attrs==23.*"
"psutil==5.*",
"rich==13.*",
"pandas==2.*",
"scikit_learn==1.*"
]

[tool.poetry.dependencies]
python = "^3.9"
h5py = "^3.7.0"
scipy = "^1.9.1"
numpy = "^1.23.3"
plotly = "^5.10.0"
attrs = "^23.2.0"
psutil = "^5.9.2"
rich = "^13.0.0"
pandas = "^2.2.0"
scikit-learn = "^1.2.1"
[project.scripts]
diffcrash = "lasso.diffcrash.run:main"
dimred = "lasso.dimred.run:main"

[tool.poetry.group.dev.dependencies]
pytest = "^8.0.0"
pytest-cov = "^5.0.0"
black = "^24.3.0"
ruff = "^0.3.7"
mkdocs = "^1.4.2"
mkdocs-material = "^9.5.0"
mkdocstrings = {extras = ["python"], version = "^0.24.3"}
mkdocs-coverage = "^1.0.0"
git-changelog = "^2.5.0"
twine = "^5.0.0"
[dependency-groups]
dev = [
"pytest==8.*",
"pytest-cov==5.*",
"black==24.*",
"ruff==0.3.*",
"mkdocs==1.*",
"mkdocs-material==9.*",
"mkdocstrings[python]==0.*",
"mkdocs-coverage==1.*",
"git-changelog==2.*",
"twine==5.*",
"go-task-bin"
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["setuptools>=78", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[tool.black]
# We allow longer lines since 80 is quite short
line-length=100

[tool.flake8]
exclude = [".git", "*migrations*"]
max-line-length = 100
3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

Loading