Skip to content

Commit e111179

Browse files
authored
Merge pull request #163 from zStupan/main
Switch to uv for dependency management
2 parents 54825ac + e595d46 commit e111179

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2932
-3006
lines changed

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: NiaARM Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
python-version: ['3.11', '3.12', '3.13', '3.14']
16+
defaults:
17+
run:
18+
shell: bash
19+
20+
steps:
21+
- uses: actions/checkout@v6
22+
- name: Install uv and set up Python
23+
uses: astral-sh/setup-uv@v7
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
enable-cache: true
27+
- name: Install the project
28+
run: uv sync --locked --all-extras --group test
29+
- name: Run tests
30+
run: uv run pytest

.github/workflows/publish.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Publish NiaARM to PyPI
2+
on:
3+
release:
4+
types:
5+
- published
6+
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
environment:
11+
name: pypi
12+
permissions:
13+
id-token: write
14+
contents: read
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v6
18+
- name: Install uv and set up Python
19+
uses: astral-sh/setup-uv@v7
20+
with:
21+
python-version: "3.13"
22+
- name: Build
23+
run: uv build
24+
- name: Publish
25+
run: uv publish

.github/workflows/test.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.gitignore

Lines changed: 83 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Byte-compiled / optimized / DLL files
22
__pycache__/
3-
*.py[cod]
3+
*.py[codz]
44
*$py.class
55

66
# C extensions
@@ -27,8 +27,8 @@ share/python-wheels/
2727
MANIFEST
2828

2929
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3232
*.manifest
3333
*.spec
3434

@@ -46,7 +46,7 @@ htmlcov/
4646
nosetests.xml
4747
coverage.xml
4848
*.cover
49-
*.py,cover
49+
*.py.cover
5050
.hypothesis/
5151
.pytest_cache/
5252
cover/
@@ -92,20 +92,64 @@ ipython_config.py
9292
# However, in case of collaboration, if having platform-specific dependencies or dependencies
9393
# having no cross-platform support, pipenv may install dependencies that don't work, or not
9494
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
95+
# Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
# uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
# poetry.lock
109+
# poetry.toml
110+
111+
# pdm
112+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115+
# pdm.lock
116+
# pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# pixi
121+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122+
# pixi.lock
123+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124+
# in the .venv directory. It is recommended not to include this directory in version control.
125+
.pixi
126+
127+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
98128
__pypackages__/
99129

100130
# Celery stuff
101131
celerybeat-schedule
102132
celerybeat.pid
103133

134+
# Redis
135+
*.rdb
136+
*.aof
137+
*.pid
138+
139+
# RabbitMQ
140+
mnesia/
141+
rabbitmq/
142+
rabbitmq-data/
143+
144+
# ActiveMQ
145+
activemq-data/
146+
104147
# SageMath parsed files
105148
*.sage.py
106149

107150
# Environments
108151
.env
152+
.envrc
109153
.venv
110154
env/
111155
venv/
@@ -137,9 +181,36 @@ dmypy.json
137181
# Cython debug symbols
138182
cython_debug/
139183

140-
# JOSS artifacts
141-
paper.pdf
142-
paper.jats
143-
144-
# Ruff
184+
# PyCharm
185+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187+
# and can be added to the global gitignore or merged into this file. For a more nuclear
188+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
189+
.idea/
190+
191+
# Abstra
192+
# Abstra is an AI-powered process automation framework.
193+
# Ignore directories containing user credentials, local state, and settings.
194+
# Learn more at https://abstra.io/docs
195+
.abstra/
196+
197+
# Visual Studio Code
198+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
201+
# you could uncomment the following to ignore the entire vscode folder
202+
.vscode/
203+
204+
# Ruff stuff:
145205
.ruff_cache/
206+
207+
# PyPI configuration file
208+
.pypirc
209+
210+
# Marimo
211+
marimo/_static/
212+
marimo/_lsp/
213+
__marimo__/
214+
215+
# Streamlit
216+
.streamlit/secrets.toml

.pre-commit-config.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.5.0
7+
rev: v6.0.0
88
hooks:
99
- id: end-of-file-fixer
1010
- id: trailing-whitespace
@@ -15,12 +15,11 @@ repos:
1515
- id: check-ast
1616
- id: check-docstring-first
1717

18-
- repo: https://github.com/psf/black-pre-commit-mirror
19-
rev: 23.10.1
20-
hooks:
21-
- id: black
2218
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: v0.1.3
19+
rev: v0.14.8
2420
hooks:
25-
- id: ruff
26-
args: [--fix, --exit-non-zero-on-fix]
21+
- id: ruff-check
22+
types_or: [ python, pyi ]
23+
args: [ --fix ]
24+
- id: ruff-format
25+
types_or: [ python, pyi ]

.readthedocs.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: 2
22

33
build:
4-
os: ubuntu-20.04
4+
os: ubuntu-24.04
55
tools:
6-
python: '3.9'
6+
python: '3.13'
77

88
python:
99
install:
@@ -12,3 +12,6 @@ python:
1212
sphinx:
1313
configuration: 'docs/conf.py'
1414
fail_on_warning: true
15+
16+
formats:
17+
- pdf

CONTRIBUTING.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This project and everyone participating in it is governed by the [NiaARM Code of
77
## How Can I Contribute?
88

99
### Reporting Bugs
10-
Before creating bug reports, please check existing issues list as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible in the [issue template](.github/templates/ISSUE_TEMPLATE.md).
10+
Before creating bug reports, please check existing issues list as you might find out that you don't need to create one. When you are creating a bug report, please include as mAll details as possible in the [issue template](.github/templates/ISSUE_TEMPLATE.md).
1111

1212
### Suggesting Enhancements
1313

@@ -21,56 +21,59 @@ Fill in the [pull request template](.github/templates/PULL_REQUEST.md) and make
2121

2222
### Requirements
2323

24-
* Poetry: [https://python-poetry.org/docs/](https://python-poetry.org/docs/)
24+
* uv: [https://docs.astral.sh/uv/](https://docs.astral.sh/uv/)
2525

26-
After installing Poetry and cloning the project from GitHub, you should run the following command from the root of the cloned project:
26+
After installing uv and cloning the project from GitHub, you should
27+
run the following command from the root of the cloned project:
2728

2829
```sh
29-
poetry install
30+
uv sync --dev
3031
```
3132

32-
All the project's dependencies should be installed and the project ready for further development. **Note that Poetry creates a separate virtual environment for your project.**
33+
All the project's development dependencies should be installed and the project ready for further development.
3334

3435
### Dependencies
3536

36-
| Package | Version | Platform |
37-
|---------|:-------:|:--------:|
38-
| niapy | ^2.0.5 | All |
39-
| numpy | ^1.26.1 | All |
40-
| pandas | ^2.1.1 | All |
41-
| nltk | ^3.8.1 | All |
42-
| tomli | ^2.0.1 | All |
37+
| Package | Version | Platform |
38+
|--------------|:--------:|:--------:|
39+
| niapy | \>=2.6.1 | All |
40+
| numpy | \>=2.3.5 | All |
41+
| pandas | \>=2.3.3 | All |
42+
| nltk | \>=3.9.2 | All |
43+
| scikit-learn | \>=1.8.0 | All |
44+
| plotly | \>=6.5.0 | All |
4345

4446
#### Development dependencies
4547

46-
| Package | Version | Platform |
47-
|------------------|:-------:|:--------:|
48-
| pytest | ^7.4.2 | Any |
49-
| pytest-cov | ^4.1.0 | Any |
50-
| pytest.randomly | ^3.15.0 | Any |
48+
| Package | Version | Platform |
49+
|-----------------|:---------:|:--------:|
50+
| pytest | \>=9.0.0 | All |
51+
| pytest-cov | \>=7.0.0 | All |
52+
| pytest.randomly | \>=4.0.1 | All |
53+
| pre-commit | \>=4.5.0 | All |
54+
| ruff | \>=0.14.9 | All |
5155

52-
#### Extras
56+
#### Documentation Dependencies
5357

54-
| Package | Version | Platform |
55-
|----------------------|:-------:|:--------:|
56-
| sphinx | ^7.2.6 | Any |
57-
| sphinx-rtd-theme | ^1.0.0 | Any |
58-
| sphinxcontrib-bibtex | ^2.4.1 | Any |
58+
| Package | Version | Platform |
59+
|----------------------|:--------:|:--------:|
60+
| sphinx | \>=8.2.3 | All |
61+
| sphinx-rtd-theme | \>=3.0.2 | All |
62+
| sphinxcontrib-bibtex | \>=2.6.5 | All |
5963

60-
## Development Tasks
61-
62-
### Testing
64+
## Testing
6365

6466
Manually run the tests:
6567

6668
```sh
67-
$ poetry run pytest
69+
uv run pytest
6870
```
6971

70-
### Documentation
72+
## Documentation
7173

7274
Build the documentation:
7375

7476
```sh
75-
$ poetry run sphinx-build ./docs ./docs/_build
77+
uv sync --group docs
78+
uv run sphinx-build ./docs ./docs/_build
7679
```

docs/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,4 @@
6868
html_logo = "_static/logo.png"
6969
html_theme_options = {
7070
"logo_only": True,
71-
"display_version": False,
7271
}

0 commit comments

Comments
 (0)