From 06f22f9541a2a03dfbb0a575c445eb4b1077dca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Rocabruna?= Date: Thu, 7 Nov 2024 21:06:51 +0100 Subject: [PATCH] fix(dependencies): remove direct URL dependency for en-core-web-sm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PyPI does not allow direct URL dependencies in package metadata, which was causing a '400 Bad Request' error during the upload process. The 'en-core-web-sm' model was previously specified with a direct URL dependency, which is incompatible with PyPI's requirements for package distributions. This commit removes the direct URL for 'en-core-web-sm' from the dependencies in 'pyproject.toml'. Instead, users are encouraged to install this language model manually or as an optional dependency documented in the README. By addressing this, we enable the package to be published on PyPI while still allowing users access to the necessary language models for functionality. Further changes: - Updated 'pyproject.toml' to reflect the adjusted dependencies without direct URLs. - Added clarification in the README for installing 'en-core-web-sm' as a manual step if needed. - Modified GitHub Actions workflows ('coverage.yml' and 'test-lint.yml') to ensure the necessary language model ('en-core-web-sm') is installed in CI/CD environments where it’s required for testing and coverage. This adjustment ensures automated tests continue to function correctly without the dependency being directly listed in the project dependencies. This fix enhances compatibility with PyPI's publishing rules and improves the overall user installation experience by providing clearer dependency management, while ensuring CI/CD workflows remain functional. --- .github/workflows/coverage.yml | 1 + .github/workflows/test-lint.yml | 1 + README.md | 14 +++++++++++--- pyproject.toml | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a80748f..564c0bc 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,6 +23,7 @@ jobs: run: | python -m pip install --upgrade pip pip install ".[dev]" + python -m spacy download en_core_web_sm - name: Run tests with coverage run: pytest --cov=spacy_ewc --cov-report xml tests/ diff --git a/.github/workflows/test-lint.yml b/.github/workflows/test-lint.yml index 85c467e..9ca5083 100644 --- a/.github/workflows/test-lint.yml +++ b/.github/workflows/test-lint.yml @@ -20,6 +20,7 @@ jobs: run: | python -m pip install --upgrade pip pip install ".[dev]" + python -m spacy download en_core_web_sm - name: Run tests run: pytest -x --disable-warnings diff --git a/README.md b/README.md index 27b7e59..a3eac77 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,17 @@ In sequential or continual learning, neural networks often suffer from **catastr - **Development dependencies** (recommended for contributors): - ```bash - pip install .[dev] - ``` + ```bash + pip install .[dev] + ``` + + After installing the development dependencies, you’ll also need to manually install the spaCy language model used in tests: + + ```bash + python -m spacy download en_core_web_sm + ``` + + _This ensures that all dependencies and the necessary language model are available for development and testing._ 4. **Download the spaCy English model (Optional)**: diff --git a/pyproject.toml b/pyproject.toml index 6877f35..23e2152 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ dev = [ "spacy-lookups-data", "flake8", "black", - "en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0.tar.gz", + # "en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0.tar.gz", ] docs = ["sphinx"]