Skip to content
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a5364c5
add uv support
AntonProkopyev Jun 8, 2025
dba2fe3
add e2e release test
AntonProkopyev Jun 8, 2025
32b54ec
add e2e pipeline
AntonProkopyev Jun 8, 2025
f012ae1
update README.md
AntonProkopyev Jun 8, 2025
2292ae6
fix path
AntonProkopyev Jun 8, 2025
6cc8959
disable shellcheck
AntonProkopyev Jun 8, 2025
b4d09e0
install uv in make and pylint
AntonProkopyev Jun 9, 2025
d89e650
revert ignoring the uv.lock and add it
AntonProkopyev Jun 9, 2025
ccb61bf
add missing copyrights
AntonProkopyev Jun 9, 2025
a45b7ed
use uv to create new release
AntonProkopyev Jun 9, 2025
3211fba
fix issues
AntonProkopyev Jun 15, 2025
1b24d13
remove unneeded export
AntonProkopyev Jun 15, 2025
d926d3d
fix .rultor.yml after rebase
AntonProkopyev Jun 15, 2025
23ba2f3
pin uv version
AntonProkopyev Jun 15, 2025
868997c
fix ty.yml to use uv for deps install
AntonProkopyev Jun 15, 2025
963df39
remove extra file
AntonProkopyev Jun 15, 2025
150c6a9
fix after rebase
AntonProkopyev Jun 15, 2025
5c55fb1
better url for uv
AntonProkopyev Jun 15, 2025
268033d
simplify readme changes
AntonProkopyev Jun 15, 2025
3d746b6
add missing line
AntonProkopyev Jun 15, 2025
1ee29f5
update uv.lock
AntonProkopyev Jun 15, 2025
27150f1
drop requirements.txt, split runtime and dev deps
AntonProkopyev Jul 5, 2025
2216779
apply coderabbit suggestions
AntonProkopyev Jul 5, 2025
28d5d64
sort deps
AntonProkopyev Jul 5, 2025
2889096
move types-requests to dev
AntonProkopyev Jul 5, 2025
d70cc95
add missing --testmon
AntonProkopyev Jul 7, 2025
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
5 changes: 5 additions & 0 deletions .github/workflows/e2e-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
with:
python-version: 3.11

- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/0.7.13/install.sh | sh
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"

- name: Build package
run: |
make build
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/make.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ jobs:
with:
ruby-version: 3.3
- run: gem install xcop
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/0.7.13/install.sh | sh
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- run: make
4 changes: 4 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/0.7.13/install.sh | sh
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- run: make requirements
- run: make pylint
14 changes: 4 additions & 10 deletions .github/workflows/ty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,15 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create venv
- name: Install uv (from Astral)
run: |
python3 -m venv .venv
curl -LsSf https://astral.sh/uv/0.7.13/install.sh | bash
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"

- name: Install aibolit dependencies
run: |
source .venv/bin/activate
python -m pip install -r requirements.txt

- name: Install uv (from Astral)
run: |
curl -LsSf https://astral.sh/uv/install.sh | bash
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
make requirements
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Run Ty
run: |
source .venv/bin/activate
uvx ty==0.0.1-alpha.8 check
10 changes: 6 additions & 4 deletions .rultor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ assets:
architect:
- yegor256
install: |
python3 -m pip install twine
curl -LsSf https://astral.sh/uv/0.7.13/install.sh | sh
source $HOME/.local/bin/env
uv tool install twine
merge:
script: |
make
Expand All @@ -18,8 +20,8 @@ release:
sed -i "s/0\.0\.0/${tag}/g" aibolit/__init__.py
git add aibolit/__init__.py
git commit -am "${tag}"
python3 --version
python3 -m pip --version
uv run python --version
uv --version
make
make e2e
python3 -m twine upload dist/* -u __token__ -p $(cat ../twine_token)
uv run twine upload dist/* -u __token__ -p $(cat ../twine_token)
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ all: requirements install test it lint xcop sphinx
lint: flake8 pylint mypy

requirements:
python3 -m pip install -r requirements.txt
uv sync

install:
python3 -m pip install .
python3 aibolit --version
uv pip install -e .
uv run aibolit --version

test:
python3 -m pytest --testmon --cov=aibolit/ test/
uv run pytest --cov=aibolit/ test/
Comment thread
AntonProkopyev marked this conversation as resolved.
Outdated

it:
python3 -m test.integration.test_patterns_and_metrics
python3 -m test.integration.test_model > /dev/null
uv run python -m test.integration.test_patterns_and_metrics
uv run python -m test.integration.test_model > /dev/null
./test/integration/test_recommend.sh

xcop:
Expand All @@ -34,27 +34,27 @@ xcop:
done < <(find . -name '*.xml' -not -path './.venv/**' -not -path './wp/**')

flake8:
python3 -m flake8 aibolit test scripts --exclude scripts/target/*
uv run flake8 aibolit test scripts --exclude scripts/target/*

pylint:
python3 -m pylint aibolit test scripts --ignore=scripts/target
uv run pylint aibolit test scripts --ignore=scripts/target

ruff:
python3 -m ruff check .
uv run ruff check .

sphinx:
rm -rf sphinx html
sphinx-apidoc -o sphinx aibolit --full
sphinx-build sphinx html
uv run sphinx-apidoc -o sphinx aibolit --full
uv run sphinx-build sphinx html

mypy:
python3 -m mypy aibolit
uv run mypy aibolit

build: requirements
python3 -m build
uv build

e2e: build
./test/e2e/test_e2e_release.sh
./test/e2e/test_e2e_release.sh dist

clean:
rm -rf build
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Learn how Aibolit works in our [White Paper].

First, you install it (you must have
[Python 3.7.7](https://www.python.org/downloads/)
[Python 3.11+](https://www.python.org/downloads/)
and [Pip](https://pip.pypa.io/en/stable/installing/) installed):

```bash
Expand Down Expand Up @@ -316,12 +316,12 @@ aibolit train --java_folder=src/java --skip_collect_dataset

First, you need to install:

* [Python 3+](https://www.python.org/downloads/)
* [Pip](https://pip.pypa.io/en/stable/installing/)
* [Python 3.11+](https://www.python.org/downloads/)
* [uv](https://docs.astral.sh/uv/)
* Ruby 2.6+
* [Xcop](https://github.com/yegor256/xcop)

Install the following packages if you don't have:
Install the following packages if you don't have them:

```bash
apt-get install ruby-dev libz-dev libxml2
Expand Down
1 change: 1 addition & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ path = [
"**/Gemfile.lock",
"README.md",
"renovate.json",
"uv.lock",
".xcop",
".flake8",
]
Expand Down
40 changes: 37 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,28 @@ authors = [
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.11"
dynamic = ["version", "dependencies", "optional-dependencies"]
dynamic = ["version"]
dependencies = [
"beautifulsoup4==4.13.4",
"build==1.2.2.post1",
"catboost==1.2.8",
"chardet==5.2.0", # Replace cchardet with chardet for Python 3.12 compatibility
"deprecated==1.2.10",
"html5lib==1.1",
"javalang==0.13.0",
"lxml==5.4.0",
"matplotlib==3.10.3",
"networkx==3.2", # Updated to be compatible with NumPy 2.0+
"numpy==2.2.5",
"packaging==25.0", # For version parsing, updated for sphinx compatibility
"pandas==2.2.3",
"pebble==4.5.3",
"requests==2.32.4",
"scikit-learn==1.6.1",
"scipy==1.15.3",
"setuptools==80.7.1",
"tqdm==4.66.3",
]
Comment thread
AntonProkopyev marked this conversation as resolved.

classifiers = [
"Programming Language :: Python",
Expand All @@ -36,8 +57,6 @@ aibolit = [

[tool.setuptools.dynamic]
version = { attr = "aibolit.__version__" }
dependencies = { file = ["requirements.txt"] }
optional-dependencies.test = { file = ["requirements.txt"] }

[build-system]
requires = ["setuptools>=61", "wheel"]
Expand All @@ -60,3 +79,18 @@ extend-select = [
docstring-quotes = "double"
inline-quotes = "single"
multiline-quotes = "single"

[dependency-groups]
dev = [
"codecov==2.1.13",
"flake8-elegant-objects==1.1.1",
"flake8==7.2.0",
"mypy==1.16.1", # Update to a version compatible with Python 3.12
"pylint==3.3.7",
"pytest-cov==6.1.1",
"pytest-testmon==2.1.3",
"pytest==8.3.5",
"ruff==0.11.11",
"sphinx==8.2.3",
"types-requests==2.32.0.20250515",
]
Comment thread
AntonProkopyev marked this conversation as resolved.
30 changes: 0 additions & 30 deletions requirements.txt

This file was deleted.

14 changes: 7 additions & 7 deletions test/e2e/test_e2e_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

set -euo pipefail

DIST_DIR=${1:-dist}

echo "Starting e2e release test..."

TEMP_VENV=$(mktemp -d)
TEMP_VENV=$(mktemp -d --suffix=test-env)
echo "Testing in temporary environment: $TEMP_VENV"

cleanup() {
Expand All @@ -15,15 +17,13 @@ cleanup() {

trap cleanup EXIT

echo "Creating fresh virtual environment"
pushd "$TEMP_VENV"
python3 -m venv test-env
echo "Creating fresh virtual environment with Python 3.11..."
uv venv --seed --python 3.11 "$TEMP_VENV"
# shellcheck disable=SC1091
source test-env/bin/activate
source "$TEMP_VENV/bin/activate"

echo "Installing built package..."
popd > /dev/null
python3 -m pip install dist/*.whl
python3 -m pip install "$DIST_DIR"/*.whl

echo "Verifying aibolit command..."
which aibolit > /dev/null
Expand Down
Loading
Loading