-
-
Notifications
You must be signed in to change notification settings - Fork 141
Fix CI for Windows #242
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
Fix CI for Windows #242
Changes from all commits
b24f21a
d6bfb37
8e7782a
2902589
cc50504
e7a0d84
f840ad2
f01da8c
860b2fa
2fcff6c
1d0270a
eb74597
df77d18
67c078a
fe0b779
7967bd2
aa5b73b
f3f1f49
bef2ccc
097b85f
ca5e242
299b8d4
ade4669
0707b21
15a3b12
cc9d3f9
2a391f9
b7d9ff4
c4f36a9
c900da0
efaf430
30cb06f
f2114e4
6047947
9b302f6
b27cecb
eceb862
48a008d
a895e18
c580318
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
|
||
- name: Install pandas-stubs and run tests on the installed stubs | ||
run: poetry run poe test_dist | ||
run: | | ||
source $VENV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the above steps we can use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned above, if I use the run script, it installs the wheel into the "system" environment, not poetry's virtual environment. |
||
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 | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class GroupByIndexingMixin: ... | ||
class GroupByPositionalSelector: ... | ||
class GroupByNthSelector: ... |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -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" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is that needed? To invalidate the cache? This should already pick the newest wheel: pandas-stubs/scripts/test/run.py Line 49 in 5b70b46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The problem here is that if I build and install the wheel from the run script, it gets installed into the wrong python environment. So now with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So pip is preferring the pypi.org wheel over the local wheel? There must be an option to ignore the remote wheel. Could also simply bump the version number after each release so that the CI works but as soon as we forget it pip will install the wrong pandas-stubs - seems a bit fragile. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue here is that we need this to work for PR's, which means that contributors have to change the version number. In the
The |
||||
description = "Type annotations for pandas" | ||||
authors = ["The Pandas Development Team <[email protected]>"] | ||||
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)" | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this key correct, the CI says it is
venv-Linux--
?This caches the (large) venv but I think it does not cache poetry.lock.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I picked this up from https://github.com/snok/install-poetry#running-on-windows
There are comments there that say that caching doesn't work on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the file poetry.lock exist on the CI? The previous caching used pyproject.toml as the key to cache poety.lock
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know. After spending hours on this last night, I was just happy to get it working.