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

bump vendored tqdm version #10266

Merged
merged 3 commits into from
Oct 12, 2020
Merged

bump vendored tqdm version #10266

merged 3 commits into from
Oct 12, 2020

Conversation

casperdcl
Copy link
Contributor

@casperdcl casperdcl commented Oct 7, 2020

If you want to check the diff, it's easiest to use your preferred folder diff tool to compare the upstream folder (https://github.com/tqdm/tqdm/tree/v4.50.2/tqdm) to the one in this PR (https://github.com/tqdm/conda/tree/bump-vendor-tqdm/conda/_vendor/tqdm). Pasted below for convenience:

Only in tqdm/tqdm: autonotebook.py
diff tqdm/tqdm/auto.py conda/conda/_vendor/tqdm/auto.py
15,40c15,41
< import sys
< import warnings
< from .std import TqdmExperimentalWarning
< with warnings.catch_warnings():
<     warnings.simplefilter("ignore", category=TqdmExperimentalWarning)
<     from .autonotebook import tqdm as notebook_tqdm
<     from .autonotebook import trange as notebook_trange
< 
< if sys.version_info[:2] < (3, 5):
<     tqdm = notebook_tqdm
<     trange = notebook_trange
< else:  # Python3.5+
<     from .asyncio import tqdm as asyncio_tqdm
<     from .std import tqdm as std_tqdm
< 
<     if notebook_tqdm != std_tqdm:
<         class tqdm(notebook_tqdm, asyncio_tqdm):
<             pass
<     else:
<         tqdm = asyncio_tqdm
< 
<     def trange(*args, **kwargs):
<         """
<         A shortcut for `tqdm.auto.tqdm(range(*args), **kwargs)`.
<         """
<         return tqdm(range(*args), **kwargs)
---
> # import sys
> # import warnings
> # from .std import TqdmExperimentalWarning
> # with warnings.catch_warnings():
> #     warnings.simplefilter("ignore", category=TqdmExperimentalWarning)
> #     from .autonotebook import tqdm as notebook_tqdm
> #     from .autonotebook import trange as notebook_trange
> #
> # if sys.version_info[:2] < (3, 5):
> #     tqdm = notebook_tqdm
> #     trange = notebook_trange
> # else:  # Python3.5+
> #     from .asyncio import tqdm as asyncio_tqdm
> #     from .std import tqdm as std_tqdm
> #
> #     if notebook_tqdm != std_tqdm:
> #         class tqdm(notebook_tqdm, asyncio_tqdm):
> #             pass
> #     else:
> #         tqdm = asyncio_tqdm
> #
> #     def trange(*args, **kwargs):
> #         """
> #         A shortcut for `tqdm.auto.tqdm(range(*args), **kwargs)`.
> #         """
> #         return tqdm(range(*args), **kwargs)
> from .std import tqdm, trange
Only in tqdm/tqdm: completion.sh
Common subdirectories: tqdm/tqdm/contrib and conda/conda/_vendor/tqdm/contrib
Only in tqdm/tqdm: gui.py
diff tqdm/tqdm/__init__.py conda/conda/_vendor/tqdm/__init__.py
0a1,8
> # source: https://raw.githubusercontent.com/tqdm/tqdm/v4.50.2/tqdm/__init__.py
> # version: 4.50.2
> # date: 2020-10-08
> # These modules are omitted:
> #   gui, notebook, keras, contrib.bells, contrib.discord, contrib.telegram
> # Also removed syscall on import in _version module.
> # Also omitted man pages & shell completions.
> 
2,4c10,12
< from .gui import tqdm as tqdm_gui  # TODO: remove in v5.0.0
< from .gui import trange as tgrange  # TODO: remove in v5.0.0
< from ._tqdm_pandas import tqdm_pandas
---
> # from .gui import tqdm as tqdm_gui  # TODO: remove in v5.0.0
> # from .gui import trange as tgrange  # TODO: remove in v5.0.0
> # from ._tqdm_pandas import tqdm_pandas
12,13c20,27
< __all__ = ['tqdm', 'tqdm_gui', 'trange', 'tgrange', 'tqdm_pandas',
<            'tqdm_notebook', 'tnrange', 'main', 'TMonitor',
---
> # __all__ = ['tqdm', 'tqdm_gui', 'trange', 'tgrange', 'tqdm_pandas',
> #            'tqdm_notebook', 'tnrange', 'main', 'TMonitor',
> #            'TqdmTypeError', 'TqdmKeyError',
> #            'TqdmWarning', 'TqdmDeprecationWarning',
> #            'TqdmExperimentalWarning',
> #            'TqdmMonitorWarning', 'TqdmSynchronisationWarning',
> #            '__version__']
> __all__ = ['tqdm', 'trange', 'main', 'TMonitor',
21,40c35,54
< def tqdm_notebook(*args, **kwargs):  # pragma: no cover
<     """See tqdm.notebook.tqdm for full documentation"""
<     from .notebook import tqdm as _tqdm_notebook
<     from warnings import warn
<     warn("This function will be removed in tqdm==5.0.0\n"
<          "Please use `tqdm.notebook.tqdm` instead of `tqdm.tqdm_notebook`",
<          TqdmDeprecationWarning, stacklevel=2)
<     return _tqdm_notebook(*args, **kwargs)
< 
< 
< def tnrange(*args, **kwargs):  # pragma: no cover
<     """
<     A shortcut for `tqdm.notebook.tqdm(xrange(*args), **kwargs)`.
<     On Python3+, `range` is used instead of `xrange`.
<     """
<     from .notebook import trange as _tnrange
<     from warnings import warn
<     warn("Please use `tqdm.notebook.trange` instead of `tqdm.tnrange`",
<          TqdmDeprecationWarning, stacklevel=2)
<     return _tnrange(*args, **kwargs)
---
> # def tqdm_notebook(*args, **kwargs):  # pragma: no cover
> #     """See tqdm.notebook.tqdm for full documentation"""
> #     from .notebook import tqdm as _tqdm_notebook
> #     from warnings import warn
> #     warn("This function will be removed in tqdm==5.0.0\n"
> #          "Please use `tqdm.notebook.tqdm` instead of `tqdm.tqdm_notebook`",
> #          TqdmDeprecationWarning, stacklevel=2)
> #     return _tqdm_notebook(*args, **kwargs)
> #
> #
> # def tnrange(*args, **kwargs):  # pragma: no cover
> #     """
> #     A shortcut for `tqdm.notebook.tqdm(xrange(*args), **kwargs)`.
> #     On Python3+, `range` is used instead of `xrange`.
> #     """
> #     from .notebook import trange as _tnrange
> #     from warnings import warn
> #     warn("Please use `tqdm.notebook.trange` instead of `tqdm.tnrange`",
> #          TqdmDeprecationWarning, stacklevel=2)
> #     return _tnrange(*args, **kwargs)
Only in tqdm/tqdm: keras.py
Only in conda/conda/_vendor/tqdm: LICENSE
Only in tqdm/tqdm: notebook.py
Only in tqdm/tqdm: tests
Only in tqdm/tqdm: tqdm.1
Only in tqdm/tqdm: _tqdm_gui.py
Only in tqdm/tqdm: _tqdm_notebook.py
Only in tqdm/tqdm: _tqdm_pandas.py
diff tqdm/tqdm/utils.py conda/conda/_vendor/tqdm/utils.py
345,346c345,347
<         import shlex
<         return [int(subprocess.check_call(shlex.split('tput ' + i))) - 1
---
>         # from shlex import split as ss
>         from conda._vendor.auxlib.compat import shlex_split_unicode as ss
>         return [int(subprocess.check_call(ss('tput ' + i))) - 1
diff tqdm/tqdm/_version.py conda/conda/_vendor/tqdm/_version.py
14,62c14,62
< # auto -extra based on commit hash (if not tagged as release)
< scriptdir = os.path.dirname(__file__)
< gitdir = os.path.abspath(os.path.join(scriptdir, "..", ".git"))
< if os.path.isdir(gitdir):  # pragma: nocover
<     try:
<         extra = None
<         # Open config file to check if we are in tqdm project
<         with io_open(os.path.join(gitdir, "config"), 'r') as fh_config:
<             if 'tqdm' in fh_config.read():
<                 # Open the HEAD file
<                 with io_open(os.path.join(gitdir, "HEAD"), 'r') as fh_head:
<                     extra = fh_head.readline().strip()
<                 # in a branch => HEAD points to file containing last commit
<                 if 'ref:' in extra:
<                     # reference file path
<                     ref_file = extra[5:]
<                     branch_name = ref_file.rsplit('/', 1)[-1]
< 
<                     ref_file_path = os.path.abspath(os.path.join(
<                         gitdir, ref_file))
<                     # check that we are in git folder
<                     # (by stripping the git folder from the ref file path)
<                     if os.path.relpath(ref_file_path, gitdir).replace(
<                             '\\', '/') != ref_file:
<                         # out of git folder
<                         extra = None
<                     else:
<                         # open the ref file
<                         with io_open(ref_file_path, 'r') as fh_branch:
<                             commit_hash = fh_branch.readline().strip()
<                             extra = commit_hash[:8]
<                             if branch_name != "master":
<                                 extra += '.' + branch_name
< 
<                 # detached HEAD mode, already have commit hash
<                 else:
<                     extra = extra[:8]
< 
<         # Append commit hash (and branch) to version string if not tagged
<         if extra is not None:
<             with io_open(os.path.join(gitdir, "refs", "tags",
<                                       'v' + __version__)) as fdv:
<                 if fdv.readline().strip()[:8] != extra[:8]:
<                     __version__ += '-' + extra
<     except Exception as e:
<         if "No such file" in str(e):
<             __version__ += "-git.UNKNOWN"
<         else:
<             raise
---
> # # auto -extra based on commit hash (if not tagged as release)
> # scriptdir = os.path.dirname(__file__)
> # gitdir = os.path.abspath(os.path.join(scriptdir, "..", ".git"))
> # if os.path.isdir(gitdir):  # pragma: nocover
> #     try:
> #         extra = None
> #         # Open config file to check if we are in tqdm project
> #         with io_open(os.path.join(gitdir, "config"), 'r') as fh_config:
> #             if 'tqdm' in fh_config.read():
> #                 # Open the HEAD file
> #                 with io_open(os.path.join(gitdir, "HEAD"), 'r') as fh_head:
> #                     extra = fh_head.readline().strip()
> #                 # in a branch => HEAD points to file containing last commit
> #                 if 'ref:' in extra:
> #                     # reference file path
> #                     ref_file = extra[5:]
> #                     branch_name = ref_file.rsplit('/', 1)[-1]
> #
> #                     ref_file_path = os.path.abspath(os.path.join(
> #                         gitdir, ref_file))
> #                     # check that we are in git folder
> #                     # (by stripping the git folder from the ref file path)
> #                     if os.path.relpath(ref_file_path, gitdir).replace(
> #                             '\\', '/') != ref_file:
> #                         # out of git folder
> #                         extra = None
> #                     else:
> #                         # open the ref file
> #                         with io_open(ref_file_path, 'r') as fh_branch:
> #                             commit_hash = fh_branch.readline().strip()
> #                             extra = commit_hash[:8]
> #                             if branch_name != "master":
> #                                 extra += '.' + branch_name
> #
> #                 # detached HEAD mode, already have commit hash
> #                 else:
> #                     extra = extra[:8]
> #
> #         # Append commit hash (and branch) to version string if not tagged
> #         if extra is not None:
> #             with io_open(os.path.join(gitdir, "refs", "tags",
> #                                       'v' + __version__)) as fdv:
> #                 if fdv.readline().strip()[:8] != extra[:8]:
> #                     __version__ += '-' + extra
> #     except Exception as e:
> #         if "No such file" in str(e):
> #             __version__ += "-git.UNKNOWN"
> #         else:
> #             raise

@anaconda-issue-bot
Copy link
Collaborator

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @casperdcl. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@casperdcl casperdcl marked this pull request as ready for review October 8, 2020 14:53
@casperdcl casperdcl requested a review from a team as a code owner October 8, 2020 14:53
@chenghlee chenghlee added this to the 4.9.0 milestone Oct 9, 2020
Copy link
Contributor

@chenghlee chenghlee left a comment

Choose a reason for hiding this comment

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

LGTM; holding off on actually merging this until the corresponding conda package shows up in the defaults channel to prevent the conda recipe from failing.

@chenghlee
Copy link
Contributor

@anaconda-issue-bot check.

@anaconda-issue-bot anaconda-issue-bot added the cla-signed [bot] added once the contributor has signed the CLA label Oct 12, 2020
@chenghlee chenghlee merged commit 60fabc0 into conda:master Oct 12, 2020
@casperdcl
Copy link
Contributor Author

great; deleted the fork. FYI failing build https://github.com/conda/conda/runs/1242855016 has nothing to do with the merge.

@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This pull request has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue or pull request if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Oct 13, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed [bot] added once the contributor has signed the CLA locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants