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

Fix tests #1248

Merged
merged 6 commits into from
Feb 3, 2025
Merged

Fix tests #1248

merged 6 commits into from
Feb 3, 2025

Conversation

serhii73
Copy link
Collaborator

No description provided.

@serhii73 serhii73 changed the title [WIP] Fix tests Fix tests Jan 24, 2025
@serhii73 serhii73 requested review from wRAR and Gallaecio January 24, 2025 11:46
@Gallaecio
Copy link
Member

Gallaecio commented Jan 27, 2025

Why remove fuzzing/requirements.txt? Are you confident it is no longer needed for oss-fuzz? (answered)

else:
probs, labels = ([], ())

return labels, np.asarray(probs)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We got some error in the test, and it is relative to numpy and this line, so I created this part of the code just copy pasting from the library
https://github.com/facebookresearch/fastText/blob/1142dc4c4ecbc19cc16eee5cdd28472e689267e6/python/fasttext_module/fasttext/FastText.py#L239
but instead
return labels, np.array(probs, copy=False) I written return labels, np.asarray(probs)

setup.cfg Outdated
dateparser/data/date_translation_data/*
dateparser/data/__init__.py
dateparser/languages/__init__.py
docs/conf.py
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the pipeline, I got some errors relative to flake, after changing no errors anymore

@@ -119,7 +119,7 @@ def test_dates_which_match_locales_are_parsed(
languages=["en"],
region="",
date_formats=["%a", "%a", "%a", "%a"],
expected_date=datetime(1969, 1, 31, 14, 4),
expected_date=datetime(1969, 1, 31, 13, 4),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just changed the digit to resolve the error in this test

@@ -642,7 +642,14 @@ def test_search_and_parse(self, shortname, string, expected, settings=None):
(
"June 23th 5 pm EST",
datetime.datetime(
2023, 6, 23, 17, 0, tzinfo=pytz.timezone("EST")
2023,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tox.ini Outdated Show resolved Hide resolved
@Gallaecio
Copy link
Member

Gallaecio commented Jan 31, 2025

I’ve refactored the CI to run extras separately and test minimum versions of dependencies, and replaced flake8 with ruff to simplify things.

I have also removed the proposed fasttext wrapper to instead limit numpy to supported versions when installing the corresponding extra. I don’t think it falls onto us to monkey-patch fasttext. If no one forks the project, we can eventually stop supporting language detection based on it.

@serhii73 serhii73 merged commit 36a5634 into master Feb 3, 2025
15 checks passed
serhii73 added a commit that referenced this pull request Feb 3, 2025
* Fix tests

* Fix the TestLocalTZOffset test

* Setup tests for minimum deps

* Run pre-commit

---------

Co-authored-by: Adrián Chaves <adrian@chaves.io>
serhii73 added a commit that referenced this pull request Feb 3, 2025
serhii73 added a commit that referenced this pull request Feb 5, 2025
* Release 1.2.1

* Update HISTORY.rst

Co-authored-by: Andrey Rakhmatullin <wrar@debian.org>

* Fix tests (#1248)

* Fix tests

* Fix the TestLocalTZOffset test

* Setup tests for minimum deps

* Run pre-commit

---------

Co-authored-by: Adrián Chaves <adrian@chaves.io>

* Add #1248 to History rst

* .bumpversion.cfg → pyproject.toml, and have it set the release date

* Undo version change to be made by bump-my-version

* Update HISTORY.rst

Co-authored-by: Adrián Chaves <adrian@chaves.io>

* Use CODECOV_TOKEN.

---------

Co-authored-by: Andrey Rakhmatullin <wrar@debian.org>
Co-authored-by: Adrián Chaves <adrian@chaves.io>
Co-authored-by: Andrey Rakhmatullin <wrar@wrar.name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants