Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'main' into hotfix/#37
# Conflicts:
#	pyproject.toml
#	scripts/test/__init__.py
#	scripts/test/procedures.py
  • Loading branch information
Breno Fernandes committed Jul 2, 2022
commit ccf6157be7050985e5584a15b6f319947a8a2e2b
24 changes: 8 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
name: 'Test'

on:
push:
paths:
- /**/*.py
- /**/*.pyi
- pyproject.toml
- .github/workflows/test.yml
pull_request:
workflow_dispatch:

[push, pull_request, workflow_dispatch]
jobs:
test:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -41,25 +33,25 @@ jobs:
run: poetry run poe create_mypy_pkg_file

- name: Run MyPy Against Source Code
run: poetry run poe run_mypy_src
run: poetry run poe mypy_src

- name: Run Pyright Against Source Code
run: poetry run poe run_pyright_src
run: poetry run poe pyright_src

- name: Run Pytest Against Source Code
run: poetry run poe run_pytest_src
run: poetry run poe pytest_src

- name: Build Distribution
run: poetry run poe build_dist

- name: Install Distribution
run: poetry run poe install_dist

- name: Remove Source Code
run: poetry run poe remove_src
- name: Rename Source Code
run: poetry run poe rename_src

- name: Run Pyright Against Distribution
run: poetry run poe run_pyright_dist
run: poetry run poe pyright_dist

- name: Run MyPy Against Distribution
run: poetry run poe run_mypy_dist
run: poetry run poe mypy_dist
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ venv.bak/
# Rope project settings
.ropeproject

# PyCharm project settings
.idea/

# mkdocs documentation
/site

Expand All @@ -128,4 +131,4 @@ dmypy.json
# Pyre type checker
.pyre/
/poetry.lock
.ideia
.idea/**/*
26 changes: 14 additions & 12 deletions pandas-stubs/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pandas.testing as testing

from ._config import (
describe_option as describe_option,
get_option as get_option,
Expand All @@ -7,6 +9,7 @@ from ._config import (
set_option as set_option,
)
from .core.api import (
NA as NA,
BooleanDtype as BooleanDtype,
Categorical as Categorical,
CategoricalDtype as CategoricalDtype,
Expand All @@ -19,18 +22,17 @@ from .core.api import (
Grouper as Grouper,
Index as Index,
IndexSlice as IndexSlice,
Int8Dtype as Int8Dtype,
Int16Dtype as Int16Dtype,
Int32Dtype as Int32Dtype,
Int64Dtype as Int64Dtype,
Int64Index as Int64Index,
Int8Dtype as Int8Dtype,
Interval as Interval,
IntervalDtype as IntervalDtype,
IntervalIndex as IntervalIndex,
MultiIndex as MultiIndex,
NA as NA,
NaT as NaT,
NamedAgg as NamedAgg,
NaT as NaT,
Period as Period,
PeriodDtype as PeriodDtype,
PeriodIndex as PeriodIndex,
Expand All @@ -40,11 +42,11 @@ from .core.api import (
Timedelta as Timedelta,
TimedeltaIndex as TimedeltaIndex,
Timestamp as Timestamp,
UInt8Dtype as UInt8Dtype,
UInt16Dtype as UInt16Dtype,
UInt32Dtype as UInt32Dtype,
UInt64Dtype as UInt64Dtype,
UInt64Index as UInt64Index,
UInt8Dtype as UInt8Dtype,
array as array,
bdate_range as bdate_range,
date_range as date_range,
Expand All @@ -61,10 +63,7 @@ from .core.api import (
unique as unique,
value_counts as value_counts,
)
from .core.tools import to_datetime as to_datetime, to_timedelta as to_timedelta
from .core.arrays.sparse import SparseDtype as SparseDtype
from .tseries import offsets as offsets
from .tseries.api import infer_freq as infer_freq
from .core.computation.api import eval as eval
from .core.reshape.api import (
concat as concat,
Expand All @@ -81,8 +80,10 @@ from .core.reshape.api import (
qcut as qcut,
wide_to_long as wide_to_long,
)
from .util._print_versions import show_versions as show_versions
from .io.json import json_normalize as json_normalize
from .core.tools import (
to_datetime as to_datetime,
to_timedelta as to_timedelta,
)
from .io.api import (
ExcelFile as ExcelFile,
ExcelWriter as ExcelWriter,
Expand All @@ -108,9 +109,10 @@ from .io.api import (
read_table as read_table,
to_pickle as to_pickle,
)

from .io.json import json_normalize as json_normalize
from .tseries import offsets as offsets
from .tseries.api import infer_freq as infer_freq
from .util._print_versions import show_versions as show_versions
from .util._tester import test as test

import pandas.testing as testing

__version__: str
4 changes: 2 additions & 2 deletions pandas-stubs/_config/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ from .config import (
option_context as option_context,
options as options,
reset_option as reset_option,
set_option as set_option)

set_option as set_option,
)
7 changes: 6 additions & 1 deletion pandas-stubs/_config/config.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from contextlib import ContextDecorator
from typing import Any, Union, overload, Literal
from typing import (
Any,
Literal,
Union,
overload,
)

def get_option(pat: str) -> Any: ...
def set_option(pat: str, val: object) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion pandas-stubs/_libs/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .interval import Interval as Interval
from .tslibs import (
NaT as NaT,
NaTType as NaTType,
Expand All @@ -7,4 +8,3 @@ from .tslibs import (
Timestamp as Timestamp,
iNaT as iNaT,
)
from .interval import Interval as Interval
51 changes: 25 additions & 26 deletions pandas-stubs/_libs/interval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ from typing import (

import numpy as np

from pandas._typing import npt

from pandas._typing import (
IntervalClosedType,
Timedelta,
Timestamp,
npt,
)

VALID_CLOSED: frozenset[str]
Expand Down Expand Up @@ -88,63 +87,63 @@ class Interval(IntervalMixin, Generic[_OrderableT]):
self: Interval[_OrderableTimesT], y: Timedelta
) -> Interval[_OrderableTimesT]: ...
@overload
def __add__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __add__(self: Interval[int], y: float) -> Interval[float]: ...
def __add__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __add__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __radd__(
self: Interval[_OrderableTimesT], y: Timedelta
) -> Interval[_OrderableTimesT]: ...
@overload
def __radd__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __radd__(self: Interval[int], y: float) -> Interval[float]: ...
def __radd__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __radd__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __sub__(
self: Interval[_OrderableTimesT], y: Timedelta
) -> Interval[_OrderableTimesT]: ...
@overload
def __sub__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __sub__(self: Interval[int], y: float) -> Interval[float]: ...
def __sub__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __sub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __rsub__(
self: Interval[_OrderableTimesT], y: Timedelta
) -> Interval[_OrderableTimesT]: ...
@overload
def __rsub__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __rsub__(self: Interval[int], y: float) -> Interval[float]: ...
def __rsub__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __rsub__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __mul__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __mul__(self: Interval[int], y: float) -> Interval[float]: ...
def __mul__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __mul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __rmul__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __rmul__(self: Interval[int], y: float) -> Interval[float]: ...
def __rmul__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __rmul__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __truediv__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __truediv__(self: Interval[int], y: float) -> Interval[float]: ...
def __truediv__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __truediv__(self: Interval[float], y: Union[int, float]) -> Interval[float]: ...
@overload
def __floordiv__(self: Interval[int], y: int) -> Interval[int]: ...
@overload
def __floordiv__(self: Interval[int], y: float) -> Interval[float]: ...
def __floordiv__(
self: Interval[int], y: _OrderableScalarT
) -> Interval[_OrderableScalarT]: ...
@overload
def __floordiv__(
self: Interval[float], y: Union[int, float]
Expand Down
1 change: 1 addition & 0 deletions pandas-stubs/_libs/missing.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

from typing import Union

class NAType:
Expand Down
14 changes: 9 additions & 5 deletions pandas-stubs/_libs/tslibs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ __all__ = [
"OutOfBoundsDatetime",
]

from .period import Period
from .timestamps import Timestamp
from .timedeltas import Timedelta
from np_datetime import OutOfBoundsDatetime as OutOfBoundsDatetime

from .nattype import (
NaT,
NaTType,
iNaT,
nat_strings,
)
from .offsets import BaseOffset, Tick
from np_datetime import OutOfBoundsDatetime as OutOfBoundsDatetime
from .offsets import (
BaseOffset,
Tick,
)
from .period import Period
from .timedeltas import Timedelta
from .timestamps import Timestamp
3 changes: 2 additions & 1 deletion pandas-stubs/_libs/tslibs/offsets.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ from typing import (
)

import numpy as np

from pandas._typing import npt

from .timedeltas import Timedelta
Expand Down Expand Up @@ -83,7 +84,7 @@ class BaseOffset:
@property
def rule_code(self) -> str: ...
def freqstr(self) -> str: ...
def apply_index(self, dtindex: "DatetimeIndex") -> "DatetimeIndex": ...
def apply_index(self, dtindex: DatetimeIndex) -> DatetimeIndex: ...
def _apply_array(self, dtarr) -> None: ...
def rollback(self, dt: datetime) -> datetime: ...
def rollforward(self, dt: datetime) -> datetime: ...
Expand Down
1 change: 1 addition & 0 deletions pandas-stubs/_libs/tslibs/period.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from __future__ import annotations

from datetime import datetime
from typing import Any

Expand Down
9 changes: 8 additions & 1 deletion pandas-stubs/_testing/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
from typing import (
Any,
List,
Optional,
Union,
)

from pandas.core.frame import DataFrame
from pandas.core.indexes.base import Index
from pandas.core.series import Series

from pandas._typing import (
FilePathOrBuffer as FilePathOrBuffer,
FrameOrSeriesUnion as FrameOrSeriesUnion,
)
from typing import Any, List, Optional, Union

lzma = ...
N: int = ...
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.