Skip to content

add typing_extensions to dependencies #25975

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

Closed
wants to merge 7 commits into from

Conversation

vaibhavhrt
Copy link
Contributor

@vaibhavhrt
Copy link
Contributor Author

@WillAyd I have added typing_extensions(without freezing the version) to both environment.yml and requirements-dev.txt manually because I am not using anaconda(not a big fan of anaconda). Take a look if everything looks alright.

@codecov
Copy link

codecov bot commented Apr 3, 2019

Codecov Report

Merging #25975 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25975      +/-   ##
==========================================
- Coverage   91.84%   91.84%   -0.01%     
==========================================
  Files         175      175              
  Lines       52550    52550              
==========================================
- Hits        48266    48262       -4     
- Misses       4284     4288       +4
Flag Coverage Δ
#multiple 90.39% <ø> (ø) ⬆️
#single 41.89% <ø> (-0.08%) ⬇️
Impacted Files Coverage Δ
pandas/io/gbq.py 75% <0%> (-12.5%) ⬇️
pandas/core/frame.py 96.79% <0%> (-0.12%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4814a28...1807a23. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 3, 2019

Codecov Report

Merging #25975 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #25975      +/-   ##
==========================================
- Coverage   91.96%   91.95%   -0.01%     
==========================================
  Files         175      175              
  Lines       52405    52408       +3     
==========================================
- Hits        48193    48191       -2     
- Misses       4212     4217       +5
Flag Coverage Δ
#multiple 90.51% <100%> (ø) ⬆️
#single 40.73% <100%> (-0.13%) ⬇️
Impacted Files Coverage Δ
pandas/core/dtypes/base.py 100% <100%> (ø) ⬆️
pandas/core/arrays/datetimelike.py 97.69% <100%> (ø) ⬆️
pandas/core/groupby/groupby.py 97.23% <100%> (ø) ⬆️
pandas/io/gbq.py 75% <0%> (-12.5%) ⬇️
pandas/core/frame.py 96.9% <0%> (-0.12%) ⬇️
pandas/util/testing.py 90.61% <0%> (-0.11%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d86553b...4abfc68. Read the comment docs.

@WillAyd
Copy link
Member

WillAyd commented Apr 3, 2019 via email

@vaibhavhrt
Copy link
Contributor Author

@WillAyd I am not sure what you mean.
Should I import Type from typing_extensions and then run tests in python 3.5.1 locally?

@WillAyd
Copy link
Member

WillAyd commented Apr 3, 2019 via email

@jreback
Copy link
Contributor

jreback commented Apr 3, 2019

we should pin one of the builds to 3.5.1

separately not averse to bumping to 3.5.3 (or whatever we need)

@WillAyd
Copy link
Member

WillAyd commented Apr 3, 2019

Makes sense. I think we could pin 3.5.1 as part of this PR and tackle maybe bumping to 3.5.3 separately if we wanted to

@WillAyd WillAyd added Dependencies Required and optional dependencies Typing type annotations, mypy/pyright type checking labels Apr 3, 2019
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to add this to all of the ci builds in the pandas/ci/deps dir

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to update setup.py & the install docs as well.

@WillAyd
Copy link
Member

WillAyd commented Apr 3, 2019 via email

@vaibhavhrt
Copy link
Contributor Author

@WillAyd I finally managed to get MS Build Tools 14 working and build pandas. I should be able to run tests locally now. But I am too busy at work today. Tomorrow I will run tests on python 3.5.1 and let you know the results. I will take care of changes requested by @jreback too tomorrow.

@TomAugspurger
Copy link
Contributor

What exactly are we using from this? If we’re only using one or two definitions, I’d rather just include those in our typing compat module. Adding a new dependency shouldn’t be done lightly.

@WillAyd
Copy link
Member

WillAyd commented Apr 4, 2019

@TomAugspurger what's the concern with third party library? There's a lot of active development with types so I think it would be more work to vendor pieces of it and keep in sync rather than to include as dependency

@vaibhavhrt
Copy link
Contributor Author

vaibhavhrt commented Apr 5, 2019

@WillAyd on python 3.5.1 even master will fail. I can't even import pandas from local build. Here is relevant part of traceback:

...
  File "C:\Users\Harish\Documents\GitHub\pandas\pandas\core\dtypes\base.py", line 2, in <module>
  from typing import List, Optional, Type
ImportError: cannot import name 'Type'

typing.Type was added in 3.5.2

I will fix this.

@vaibhavhrt vaibhavhrt changed the title add typing_extensions to environment and requirements add typing_extensions to dependencies Apr 5, 2019
@vaibhavhrt
Copy link
Contributor Author

vaibhavhrt commented Apr 5, 2019

@WillAyd After adding typing_extensions to dependency and importing Type from typing_extensions
I got the following test results:

 22 failed, 47816 passed, 1368 skipped, 1028 xfailed, 15 xpassed, 3469 warnings in 4985.95 seconds

I can't see how any of the changes I made can make tests fail. I have pushed the changes, you can see tests results on travis and let me know how to fix it.

@vaibhavhrt
Copy link
Contributor Author

@WillAyd tests are passing on travis but not locally, don't know why. Also some azure tests for mac and linux are failing. Do I remove typing-extensions from yml of those tests or should I install them from pip instead of conda?

@WillAyd
Copy link
Member

WillAyd commented Apr 5, 2019 via email

@vaibhavhrt
Copy link
Contributor Author

@WillAyd running tests locally takes a long time. I will worry about that some other time. Travis tests(for my fork too) is passing, so there is something wrong with my system. For now please let me know to fix the Azure tests(some of them are failing). They all have similar issue:

conda env create -q --file=ci/deps/azure-macos-35.yaml
Warning: you have pip-installed dependencies in your environment file, but you do not list pip itself as one of your conda dependencies.  Conda may not use the correct pip to install your packages, and they may end up in the wrong place.  Please add an explicit pip dependency.  I'm adding one for you, but still nagging you.
Collecting package metadata: ...working... done
Solving environment: ...working... failed
WARNING: The conda.compat module is deprecated and will be removed in a future release.

ResolvePackageNotFound: 
  - typing-extensions

##[error]Bash exited with code '1'.

I think I need to change to something in the the yaml files of these tests but not sure what.

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Apr 5, 2019 via email

@WillAyd
Copy link
Member

WillAyd commented Apr 5, 2019 via email

@jreback
Copy link
Contributor

jreback commented Apr 16, 2019

Hmm ok. So you think better to just add Type and Final to our internal typing package? Not opposed if that’s easier

yes let's just add what we need to _typing, rather that this dep.

@vaibhavhrt
Copy link
Contributor Author

@jreback if no one is already working on adding Type and Final to pandas.typing I can do that. Let me know if I should open a new issue and PR for that. I am closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Required and optional dependencies Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add dependency typing_extensions for type hints
4 participants