Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Update cached_path version #5665

Merged
merged 21 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from 20 commits
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
58 changes: 30 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ on:
env:
# NOTE: Need to update `TORCH_VERSION`, and `TORCH_*_INSTALL` for new torch releases.
TORCH_VERSION: 1.11.0
TORCH_CPU_INSTALL: conda install pytorch torchvision torchaudio cpuonly -c pytorch
TORCH_GPU_INSTALL: conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
# TORCH_CPU_INSTALL: conda install pytorch torchvision torchaudio cpuonly -c pytorch
# TORCH_GPU_INSTALL: conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
TORCH_CPU_INSTALL: pip install torch torchvision torchaudio
TORCH_GPU_INSTALL: pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
# Change this to invalidate existing cache.
CACHE_PREFIX: v11
# Disable tokenizers parallelism because this doesn't help, and can cause issues in distributed tests.
Expand Down Expand Up @@ -82,7 +84,7 @@ jobs:
checks:
name: ${{ matrix.task.name }}
runs-on: ${{ matrix.task.runs_on }}
timeout-minutes: 30
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -151,14 +153,14 @@ jobs:
- name: Setup virtual environment (no cache hit)
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
run: |
conda create -y -p .venv python=${{ env.DEFAULT_PYTHON_VERSION }}
conda activate ./.venv
python${{ env.DEFAULT_PYTHON_VERSION }} -m venv .venv
source .venv/bin/activate
make install TORCH_INSTALL="$TORCH_INSTALL"

- name: Setup virtual environment (cache hit)
if: steps.virtualenv-cache.outputs.cache-hit == 'true'
run: |
conda activate ./.venv
source .venv/bin/activate
pip install --no-deps -e .[all]
make download-extras

Expand All @@ -167,24 +169,24 @@ jobs:
env:
ALLENNLP_VERSION_OVERRIDE: "" # Don't replace the core library.
run: |
conda activate ./.venv
source .venv/bin/activate
git clone https://github.com/allenai/allennlp-models.git
cd allennlp-models
pip install -e .[dev,all]

- name: Debug info
run: |
conda activate ./.venv
conda list
source .venv/bin/activate
pip freeze

- name: Ensure torch up-to-date
run: |
conda activate ./.venv
source .venv/bin/activate
python scripts/check_torch_version.py

- name: ${{ matrix.task.name }}
run: |
conda activate ./.venv
source .venv/bin/activate
${{ matrix.task.run }}

- name: Prepare coverage report
Expand All @@ -205,7 +207,7 @@ jobs:
run: |
# Could run into issues with the cache if we don't uninstall the editable.
# See https://github.com/pypa/pip/issues/4537.
conda activate ./.venv
source .venv/bin/activate
pip uninstall --yes allennlp allennlp-models

upload_coverage:
Expand Down Expand Up @@ -276,27 +278,27 @@ jobs:
- name: Setup virtual environment (no cache hit)
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
run: |
conda create -y -p .venv python=${{ env.DEFAULT_PYTHON_VERSION }}
conda activate ./.venv
python${{ env.DEFAULT_PYTHON_VERSION }} -m venv .venv
source .venv/bin/activate
make install TORCH_INSTALL="$TORCH_INSTALL"

- name: Setup virtual environment (cache hit)
if: steps.virtualenv-cache.outputs.cache-hit == 'true'
run: |
conda activate ./.venv
source .venv/bin/activate
pip install --no-deps -e .[all]
make download-extras

- name: Debug info
run: |
conda activate ./.venv
source .venv/bin/activate
pip freeze

- name: Check and set nightly version
if: github.event_name == 'schedule'
run: |
# Verify that current version is ahead of the last release.
conda activate ./.venv
source .venv/bin/activate
LATEST=$(scripts/get_version.py latest)
CURRENT=$(scripts/get_version.py current)
if [ "$CURRENT" == "$LATEST" ]; then
Expand All @@ -312,7 +314,7 @@ jobs:
if: github.event_name == 'release'
run: |
# Remove 'refs/tags/' to get the actual tag from the release.
conda activate ./.venv
source .venv/bin/activate
TAG=${GITHUB_REF#refs/tags/};
VERSION=$(scripts/get_version.py current)
if [ "$TAG" != "$VERSION" ]; then
Expand All @@ -323,7 +325,7 @@ jobs:
- name: Build core package
run: |
# Just print out the version for debugging.
conda activate ./.venv
source .venv/bin/activate
make version
python setup.py bdist_wheel sdist

Expand All @@ -336,7 +338,7 @@ jobs:
- name: Clean up
if: always()
run: |
conda activate ./.venv
source .venv/bin/activate
pip uninstall --yes allennlp

# Tests installing from the distribution files.
Expand Down Expand Up @@ -484,21 +486,21 @@ jobs:
- name: Setup virtual environment (no cache hit)
if: steps.virtualenv-cache.outputs.cache-hit != 'true'
run: |
conda create -y -p .venv python=${{ env.DEFAULT_PYTHON_VERSION }}
conda activate ./.venv
python${{ env.DEFAULT_PYTHON_VERSION }} -m venv .venv
source .venv/bin/activate
make install TORCH_INSTALL="$TORCH_INSTALL"

- name: Setup virtual environment (cache hit)
if: steps.virtualenv-cache.outputs.cache-hit == 'true'
run: |
conda activate ./.venv
source .venv/bin/activate
pip install --no-deps -e .[all]
make download-extras

- name: Debug info
run: |
conda activate ./.venv
conda list
source .venv/bin/activate
pip freeze

- name: Prepare environment
run: |
Expand All @@ -512,7 +514,7 @@ jobs:

- name: Build docs
run: |
conda activate ./.venv
source .venv/bin/activate
./scripts/build_docs.sh

- name: Print the ref
Expand Down Expand Up @@ -544,7 +546,7 @@ jobs:
run: |
# Fail immediately if any step fails.
set -e
conda activate ./.venv
source .venv/bin/activate

LATEST=$(./scripts/get_version.py latest)
STABLE=$(./scripts/get_version.py stable)
Expand Down Expand Up @@ -602,7 +604,7 @@ jobs:
- name: Clean up
if: always()
run: |
conda activate ./.venv
source .venv/bin/activate
pip uninstall --yes allennlp

# Publish the core distribution files to PyPI.
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Added metric `FBetaVerboseMeasure` which extends `FBetaMeasure` to ensure compatibility with logging plugins and add some options.

### Fixed

- Fix error from `cached-path` version update.

## [v2.9.3](https://github.com/allenai/allennlp/releases/tag/v2.9.3) - 2022-04-13

### Added
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ install :
# python setup.py install_egg_info
# Install torch ecosystem first.
$(TORCH_INSTALL)
pip install -e .[dev,all]
pip install pip-tools
pip-compile requirements.txt dev-requirements.txt -o final_requirements.txt --allow-unsafe --rebuild --verbose
pip install -e . -r final_requirements.txt
# These nltk packages are used by the 'checklist' module.
$(NLTK_DOWNLOAD_CMD)

Expand Down
3 changes: 0 additions & 3 deletions allennlp/common/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
import lmdb
from torch import Tensor

from allennlp.common import logging as common_logging


logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -132,7 +130,6 @@ def cached_path(
Use this flag with caution! This can lead to race conditions if used
from multiple processes on the same file.
"""
_cached_path.file_friendly_logging(common_logging.FILE_FRIENDLY_LOGGING)
return str(
_cached_path.cached_path(
url_or_filename,
Expand Down
30 changes: 17 additions & 13 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#### TESTING-RELATED PACKAGES ####

# Checks style, syntax, and other useful errors.
flake8
flake8>=4.0.1

# Static type checking
mypy==0.960
Expand All @@ -10,42 +10,46 @@ mypy==0.960
black==22.3.0

# Allows generation of coverage reports with pytest.
pytest-cov
pytest-cov>=3.0.0

# Allows codecov to generate coverage reports
coverage
codecov
coverage[toml]>=6.4
codecov>=2.1.12

# Optional dependencies, which we install for testing purposes.
matplotlib>=2.2.3

# For mocking HTTP requests/responses.
responses>=0.12
responses>=0.21

# For running tests that aren't 100% reliable.
flaky
flaky>=3.7.0

# For running benchmarks.
pytest-benchmark
pytest-benchmark>=3.4.1

#### DOC-RELATED PACKAGES ####

# YAML manipulation
ruamel.yaml
ruamel.yaml>=0.17.17

# Generating markdown files from Python modules.
pydoc-markdown>=4.0.0,<5.0.0
databind.core
docspec<2.0.0
docspec-python<2.0.0
pydoc-markdown<4.4.0
databind.core<=1.5.0
databind-json<=1.5.0
docspec<1.2.0,>1.0.1
docspec-python<1.2.0,>1.0.1

mkdocs==1.3.0
mkdocs-material>=5.5.0,<8.3.0
markdown-include==0.6.0

# Narrowing constraints
pymdown-extensions>=9.5

#### PACKAGE-UPLOAD PACKAGES ####

# Pypi uploads
twine>=1.11.0
twine>=1.11.0,<4.0.0
setuptools
wheel
40 changes: 25 additions & 15 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,48 @@
################################
###### Core dependencies #######
################################
torch>=1.6.0,<1.12.0
torch>=1.10.0,<1.12.0
torchvision>=0.8.1,<0.13.0
cached-path>=1.0.2,<1.2.0
cached-path>=1.1.3,<1.2.0
fairscale==0.4.6
jsonnet>=0.10.0 ; sys.platform != 'win32'
nltk
nltk>=3.6.5
spacy>=2.1.0,<3.4
numpy
numpy>=1.21.4
tensorboardX>=1.2
requests>=2.18
requests>=2.28
tqdm>=4.62
h5py
scikit-learn
scipy
pytest
h5py>=3.6.0
scikit-learn>=1.0.1
scipy>=1.7.3
pytest>=6.2.5
transformers>=4.1,<4.19
sentencepiece
sentencepiece>=0.1.96
dataclasses;python_version<'3.7'
filelock>=3.3,<3.8
lmdb
more-itertools
lmdb>=1.2.1
more-itertools>=8.12.0
termcolor==1.1.0
wandb>=0.10.0,<0.13.0
huggingface_hub>=0.0.16
dill
base58
dill>=0.3.4
base58>=2.1.1

# Spacy depends on typer, and typer had a bug. This is how we make sure we get the fixed version of typer.
typer>=0.4.1

# Narrowing constraints
rich==12.1

# Indirect dependency of cached-path
# pyasn1<0.5.0,>=0.4.8
# pyasn1-modules>=0.2.8

# Protobuf is a dependency of wandb and tensorboard, but they are missing this pin.
protobuf<=3.20.0
protobuf==3.20.0

# We need this for building the Docker image
traitlets>5.1.1

##################################################
###### Extra dependencies for integrations #######
Expand Down
Loading