Skip to content

Commit

Permalink
Merge pull request #1 from timotta/p10
Browse files Browse the repository at this point in the history
Python 3.10
  • Loading branch information
timotta authored May 21, 2024
2 parents ef2f1c0 + 71ba738 commit 0ac4545
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 11 deletions.
Binary file modified .coverage
Binary file not shown.
25 changes: 21 additions & 4 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,39 @@ permissions:
contents: read

jobs:
deploy:

quality:
strategy:
matrix:
version: ['3.10', '3.11']
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
python-version: ${{ matrix.version }}
- name: Install
run: make install
- name: Lint
run: make lint
- name: Test
run: make test

deploy:
runs-on: ubuntu-latest
needs: quality
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Build
run: make build
env:
VERSION: ${{ steps.version.outputs.id }}
- name: Install
run: make install
- name: Get version
id: version
uses: iawia002/get-tag-or-commit-id@v1
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ permissions:
contents: read

jobs:
deploy:

quality:
strategy:
matrix:
version: ['3.10', '3.11']
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
python-version: ${{ matrix.version }}
- name: Install
run: make install
- name: Lint
Expand Down
8 changes: 7 additions & 1 deletion positional_vectorizer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from sklearn.feature_extraction.text import _VectorizerMixin
from sklearn.base import BaseEstimator
from typing import Self, List
from typing import List
from scipy.sparse._csr import csr_matrix
import math

# Python 3.10 has no Self on typing module
try:
from typing import Self # type: ignore[attr-defined]
except Exception:
from typing_extensions import Self


class PositionalVectorizer(_VectorizerMixin, BaseEstimator):

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
scikit-learn>=1.4.2
scikit-learn>=1.4.2
typing-extensions>=4.11.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def read_multiline_as_list(file_path: str) -> List[str]:
# '',
],
},
python_requires=">=3.11, <3.12",
python_requires=">=3.10, <3.12",
install_requires=requirements,
)

0 comments on commit 0ac4545

Please sign in to comment.