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

Relieve dependency constraints #227

Merged
merged 4 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ on:

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
name: Build wheels on ${{ matrix.os }}/${{ matrix.arch || '*' }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: pypa/[email protected]
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: "x86_64 arm64"

- uses: actions/upload-artifact@v2
with:
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,25 @@ on:
workflow_dispatch:
pull_request:
branches:
- v*.*.*
- build-*
- v*.*.*
- build-*

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-10.15]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: pypa/[email protected]
# 2.4 is too low (can't build for macos, 2.16 is too high (OpenSSL issues)
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: "x86_64 arm64"

build_sdist:
name: Build source distribution
Expand Down
2 changes: 1 addition & 1 deletion edsnlp/data/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class StandoffDoc2DictConverter:
def __init__(
self,
*,
span_getter: SpanGetterArg = None,
span_getter: Optional[SpanGetterArg] = None,
span_attributes: AttributesMappingArg = {},
):
self.span_getter = span_getter
Expand Down
2 changes: 1 addition & 1 deletion edsnlp/pipes/core/terminology/terminology.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def __init__(
ignore_excluded: bool = False,
ignore_space_tokens: bool = False,
term_matcher: Literal["exact", "simstring"] = "exact",
term_matcher_config: Dict[str, Any] = None,
term_matcher_config: Optional[Dict[str, Any]] = None,
label,
span_setter: SpanSetterArg = {"ents": True},
):
Expand Down
2 changes: 1 addition & 1 deletion edsnlp/pipes/misc/dates/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __init__(
relative: Optional[List[str]] = None,
duration: Optional[List[str]] = None,
false_positive: Optional[List[str]] = None,
on_ents_only: Union[bool, str, Iterable[str]] = None,
on_ents_only: Optional[Union[bool, str, Iterable[str]]] = None,
span_getter: Optional[SpanGetterArg] = None,
merge_mode: Literal["intersect", "align"] = "intersect",
detect_periods: bool = False,
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/family/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def __init__(
family: Optional[List[str]] = None,
termination: Optional[List[str]] = None,
use_sections: bool = True,
span_getter: SpanGetterArg = None,
on_ents_only: Union[bool, str, List[str], Set[str]] = None,
span_getter: Optional[SpanGetterArg] = None,
on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None,
explain: bool = False,
):
terms = dict(
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/history/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def __init__(
history_limit: int = 14,
closest_dates_only: bool = True,
exclude_birthdate: bool = True,
span_getter: SpanGetterArg = None,
on_ents_only: Union[bool, str, List[str], Set[str]] = None,
span_getter: Optional[SpanGetterArg] = None,
on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None,
explain: bool = False,
):
terms = dict(
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/hypothesis/hypothesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def __init__(
verbs_hyp: Optional[List[str]] = None,
termination: Optional[List[str]] = None,
attr: str = "NORM",
span_getter: SpanGetterArg = None,
on_ents_only: Union[bool, str, List[str], Set[str]] = None,
span_getter: Optional[SpanGetterArg] = None,
on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None,
within_ents: bool = False,
explain: bool = False,
):
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/negation/negation.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def __init__(
verbs: Optional[List[str]] = None,
termination: Optional[List[str]] = None,
attr: str = "NORM",
span_getter: SpanGetterArg = None,
on_ents_only: Union[bool, str, List[str], Set[str]] = None,
span_getter: Optional[SpanGetterArg] = None,
on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None,
within_ents: bool = False,
explain: bool = False,
):
Expand Down
4 changes: 2 additions & 2 deletions edsnlp/pipes/qualifiers/reported_speech/reported_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def __init__(
quotation: Optional[List[str]] = None,
verbs: Optional[List[str]] = None,
attr: str = "NORM",
span_getter: SpanGetterArg = None,
on_ents_only: Union[bool, str, List[str], Set[str]] = None,
span_getter: Optional[SpanGetterArg] = None,
on_ents_only: Optional[Union[bool, str, List[str], Set[str]]] = None,
within_ents: bool = False,
explain: bool = False,
):
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ dependencies = [
"numpy>=1.15.0; python_version>='3.8'",
"pandas>=1.1.0,<2.0.0; python_version<'3.8'",
"pandas>=1.4.0,<2.0.0; python_version>='3.8'",
"typing_extensions!=4.7.0,>=4.0.0; python_version>='3.8'", # https://github.com/explosion/spaCy/issues/12659
"typing_extensions>=4.0.0; python_version<'3.8'",
"typing-extensions>=4.0.0",
"dill",
# Packaging
"build>=1.0.0",
"toml",
"pyarrow>=3.0.0", # support for fragment.metadata.num_rows
# this is only to avoid backtracking issues with spacy's capping
"pydantic<2.0.0; python_version<'3.8'",
"pydantic-core<2.0.0; python_version<'3.8'",
]
[project.optional-dependencies]
dev = [
Expand Down
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from datetime import datetime

import pandas as pd
import pytest
import spacy
from pytest import fixture

Expand Down Expand Up @@ -151,7 +152,6 @@ def df_notes():


def make_df_note(text, module):
import databricks.koalas # noqa F401
from pyspark.sql import types as T
from pyspark.sql.session import SparkSession

Expand Down Expand Up @@ -180,6 +180,10 @@ def make_df_note(text, module):
return notes

if module == "koalas":
try:
import databricks.koalas # noqa F401
except ImportError:
pytest.skip("Koalas not installed")
return notes.to_koalas()


Expand Down
Loading