Skip to content

Commit

Permalink
fix(dependencies): remove direct URL dependency for en-core-web-sm
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JRocabruna committed Nov 7, 2024
1 parent 04347e3 commit 06f22f9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)**:

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down

0 comments on commit 06f22f9

Please sign in to comment.