Skip to content

Commit

Permalink
Added python 3.11 and 3.12 support (#126)
Browse files Browse the repository at this point in the history
- Added Python `3.11` support (without `nmslib`)
- Added Python `3.12` support (without `nmslib` and `lightfm`) 
- [Breaking] Removed Python `3.7` support 
- [Breaking] Updated minimum versions of `numpy`, `scipy`, `pandas`,
`typeguard`
- [Breaking] Set restriction `scipy < 1.13` 

Closes #128
  • Loading branch information
feldlime authored Apr 28, 2024
1 parent db8dccf commit accd327
Show file tree
Hide file tree
Showing 39 changed files with 1,688 additions and 2,531 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"

- name: Install poetry
run: pip install urllib3==1.26.15 poetry==1.4.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "3.10"

- name: Install poetry
run: pip install urllib3==1.26.15 poetry==1.4.0
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.10"

- name: Install poetry
run: pip install urllib3==1.26.15 poetry==1.4.0
Expand All @@ -28,7 +28,7 @@ jobs:
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-3.8-${{ hashFiles('**/poetry.lock') }}
key: venv-lint-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
Expand All @@ -38,16 +38,12 @@ jobs:
run: make lint

test:
name: test (${{ matrix.python-version }}, old-deps - ${{ matrix.old-deps }})
name: test ${{ matrix.python-version }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
old-deps: [ "false" ]
include:
- python-version: "3.7"
old-deps: "true"
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]

steps:
- uses: actions/checkout@v2
Expand All @@ -65,16 +61,12 @@ jobs:
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ matrix.python-version }}-old-deps-${{ matrix.old-deps }}-${{ hashFiles('**/poetry.lock') }}
key: venv-test-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: make install

- name: Install old dependencies versions
if: matrix.old-deps == 'true'
run: poetry run pip install -r requirements-old-versions.txt

- name: Run tests
run: make test

Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [Breaking] Default value for train dataset type and params for user and item dataset types in `DSSMModel` ([#122](https://github.com/MobileTeleSystems/RecTools/pull/122))
- [Breaking] `n_factors` and `deterministic` params to `DSSMModel` ([#122](https://github.com/MobileTeleSystems/RecTools/pull/122))
- Hit Rate metric ([#124](https://github.com/MobileTeleSystems/RecTools/pull/124))
- Python `3.11` support (without `nmslib`) ([#126](https://github.com/MobileTeleSystems/RecTools/pull/126))
- Python `3.12` support (without `nmslib` and `lightfm`) ([#126](https://github.com/MobileTeleSystems/RecTools/pull/126))

### Changed
- Changed the logic of choosing random sampler for `RandomModel` and increased the sampling speed ([#120](https://github.com/MobileTeleSystems/RecTools/pull/120))
- [Breaking] Changed the logic of `RandomModel`: now the recommendations are different for repeated calls of recommend methods ([#120](https://github.com/MobileTeleSystems/RecTools/pull/120))
- Torch datasets to support warm recommendations ([#122](https://github.com/MobileTeleSystems/RecTools/pull/122))
- [Breaking] Replaced `include_warm` parameter in `Dataset.get_user_item_matrix` to pair `include_warm_users` and `include_warm_items` ([#122](https://github.com/MobileTeleSystems/RecTools/pull/122))
- [Breaking] Renamed torch datasets and `dataset_type` to `train_dataset_type` param in `DSSMModel` ([#122](https://github.com/MobileTeleSystems/RecTools/pull/122))
- [Breaking] Updated minimum versions of `numpy`, `scipy`, `pandas`, `typeguard` ([#126](https://github.com/MobileTeleSystems/RecTools/pull/126))
- [Breaking] Set restriction `scipy < 1.13` ([#126](https://github.com/MobileTeleSystems/RecTools/pull/126))

### Removed
- `return_external_ids` parameter in `recommend` and `recommend_to_items` model methods ([#77](https://github.com/MobileTeleSystems/RecTools/pull/77))
- [Breaking] `return_external_ids` parameter in `recommend` and `recommend_to_items` model methods ([#77](https://github.com/MobileTeleSystems/RecTools/pull/77))
- [Breaking] Python `3.7` support ([#126](https://github.com/MobileTeleSystems/RecTools/pull/126))


## [0.5.0] - 22.03.2024
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ install: .venv .reports
poetry run pytest ${TESTS} --cov=${SOURCES} --cov-report=xml

.doctest:
poetry run pytest --doctest-modules ${SOURCES}
poetry run pytest --doctest-modules ${SOURCES} --ignore=rectools/tools/ann.py --ignore=rectools/models/lightfm.py

coverage: .venv .reports
poetry run coverage run --source ${SOURCES} --module pytest
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Security Policy

**Supported Python versions**

3.7 or above
3.8 or above

**Product development security recommendations**

Expand Down
2 changes: 1 addition & 1 deletion benchmark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Benchmark RecTools models on a dataset chosen.
One can choose either a built-in dataset or a custom dataset.
Benchmark calcuation includes fitting a model, evaluating recommender metrics and profiling
Benchmark calculation includes fitting a model, evaluating recommender metrics and profiling
time and memory required for calculations.
Subpackages
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Install from PyPi using pip
$ pip install rectools
RecTools is compatible with all operating systems and with Python 3.7+.
RecTools is compatible with all operating systems and with Python 3.8+.
The default version doesn't contain all the dependencies. Optional dependencies are the following:

lightfm: adds wrapper for LightFM model,
Expand Down
Loading

0 comments on commit accd327

Please sign in to comment.