Skip to content
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

Added python 3.11 and 3.12 support #126

Merged
merged 29 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f43f535
added python 3.11 and 3.12 support
feldlime Apr 26, 2024
fe3085a
removed python 3.7 support
feldlime Apr 26, 2024
3485c76
updated minimum numpy version
feldlime Apr 26, 2024
da04610
updated package classifiers
feldlime Apr 26, 2024
4d6ac9c
updated security.md
feldlime Apr 26, 2024
582dec0
updated docs
feldlime Apr 26, 2024
be3b061
updated minimum dependancy versions
feldlime Apr 26, 2024
eef2917
removed code supporting old versions
feldlime Apr 26, 2024
f1762cd
updated dev dependancy versions
feldlime Apr 26, 2024
ba7bea4
updated lock file
feldlime Apr 26, 2024
b3ad55c
fixed test workflow
feldlime Apr 26, 2024
75c6e76
adjusted dependancy versions
feldlime Apr 26, 2024
5a5775b
restricted nmslib for python < 3.11
feldlime Apr 26, 2024
860e599
added comment
feldlime Apr 26, 2024
d88ba2a
formatted
feldlime Apr 26, 2024
0c034a7
fixed flake
feldlime Apr 26, 2024
0054c0a
fixed codespell
feldlime Apr 26, 2024
dfcdce2
restricted scipy version
feldlime Apr 26, 2024
1398518
changed setup -> setup_method
feldlime Apr 26, 2024
3d1f657
fixed typo
feldlime Apr 26, 2024
5304a0d
updated code for new typeguard version
feldlime Apr 26, 2024
f4d22b2
fixed linter errors
feldlime Apr 26, 2024
7ac011f
updated changelog
feldlime Apr 26, 2024
9f780c0
fixed workflow job name
feldlime Apr 26, 2024
580e82e
skipped AnnRecommender tests for python >= 3.11
feldlime Apr 26, 2024
c6594f1
restricted lightfm with python <3.12
feldlime Apr 26, 2024
31eefd4
updated changelog
feldlime Apr 26, 2024
beee97d
ignored import error
feldlime Apr 26, 2024
d5431a0
tried to fix lightfm test for 3.12
feldlime Apr 26, 2024
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
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
Loading