diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e8d7152e6..7dd00e127 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,6 +12,10 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] python-version: ['3.8', '3.9', '3.10'] + defaults: + run: + shell: bash + steps: - uses: actions/checkout@v3 @@ -22,32 +26,47 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Poetry - run: pip install poetry==1.1.15 - - - name: Determine poetry version - run: echo "::set-output name=VERSION::$(poetry --version)" - id: poetry_version - - - name: Cache poetry.lock - uses: actions/cache@v3 + uses: snok/install-poetry@v1 with: - path: poetry.lock - key: ${{ matrix.os }}-${{ matrix.python-version }}-poetry-${{ steps.poetry_version.outputs.VERSION }}-${{ hashFiles('pyproject.toml') }} + virtualenvs-create: true + virtualenvs-in-project: true + + - name: Load cached venv + id: cached-pip-wheels + uses: actions/cache@v2 + with: + path: ~/.cache + key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} - name: Install project dependencies run: poetry install -vvv --no-root - name: Run mypy on 'tests' (using the local stubs) and on the local stubs - run: poetry run poe mypy + run: | + source $VENV + poetry run poe mypy - name: Run pyright on 'tests' (using the local stubs) and on the local stubs - run: poetry run poe pyright + run: | + source $VENV + poetry run poe pyright - name: Run pytest - run: poetry run poe pytest + run: | + source $VENV + poetry run poe pytest - if: matrix.python-version == '3.8' && matrix.os == 'ubuntu-latest' uses: pre-commit/action@v3.0.0 - name: Install pandas-stubs and run tests on the installed stubs - run: poetry run poe test_dist + run: | + source $VENV + poetry build -f wheel + python -m pip install --find-links=./dist --force-reinstall pandas-stubs + mv pandas-stubs _pandas-stubs + mypy tests --no-incremental + pyright tests + mv _pandas-stubs pandas-stubs + + diff --git a/pandas-stubs/core/dtypes/generic.pyi b/pandas-stubs/core/dtypes/generic.pyi new file mode 100644 index 000000000..cdcc2a9ba --- /dev/null +++ b/pandas-stubs/core/dtypes/generic.pyi @@ -0,0 +1,31 @@ +def create_pandas_abc_type(name, attr, comp): ... + +class ABCIndex: ... +class ABCInt64Index: ... +class ABCUInt64Index: ... +class ABCRangeIndex: ... +class ABCFloat64Index: ... +class ABCMultiIndex: ... +class ABCDatetimeIndex: ... +class ABCTimedeltaIndex: ... +class ABCPeriodIndex: ... +class ABCCategoricalIndex: ... +class ABCIntervalIndex: ... +class ABCIndexClass: ... +class ABCSeries: ... +class ABCDataFrame: ... +class ABCSparseArray: ... +class ABCCategorical: ... +class ABCDatetimeArray: ... +class ABCTimedeltaArray: ... +class ABCPeriodArray: ... +class ABCPeriod: ... +class ABCDateOffset: ... +class ABCInterval: ... +class ABCExtensionArray: ... +class ABCPandasArray: ... + +class _ABCGeneric(type): + def __instancecheck__(cls, inst) -> bool: ... + +class ABCGeneric: ... diff --git a/pandas-stubs/core/groupby/indexing.pyi b/pandas-stubs/core/groupby/indexing.pyi new file mode 100644 index 000000000..2abcc696e --- /dev/null +++ b/pandas-stubs/core/groupby/indexing.pyi @@ -0,0 +1,3 @@ +class GroupByIndexingMixin: ... +class GroupByPositionalSelector: ... +class GroupByNthSelector: ... diff --git a/pyproject.toml b/pyproject.toml index a8678c611..1fea54512 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [tool.poetry] name = "pandas-stubs" -version = "1.4.3.220829" +# Use the big version number so in CI, it will use the built wheel +version = "1.4.3.999999" description = "Type annotations for pandas" authors = ["The Pandas Development Team "] license = "BSD-3-Clause" @@ -56,6 +57,9 @@ pyreadstat = ">=1.1.9" requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" +[tool.poe.executor] +type = "virtualenv" + [tool.poe.tasks.test_all] help = "Run all tests" script = "scripts.test:test(src=True, dist=True)"