Skip to content

Commit

Permalink
fix version problem with sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
davebulaval committed Jul 9, 2024
1 parent c0ba25e commit 4c12bb6
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 47 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,4 +352,8 @@
- Fix circular import in the API app.
- Fix deprecated `max_request_body_size` in Sentry.

## 0.9.11

- Fix Sentry version error in Docker Image.

## dev
4 changes: 2 additions & 2 deletions app_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fastapi[all]
fastapi[all]==0.109.1
uvicorn
sentry-sdk[fastapi]
sentry-sdk[fastapi]>=2.0.0
python-decouple
pydantic
4 changes: 2 additions & 2 deletions deepparse/parser/address_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ def __init__(
# Validate if we have the proper metadata, it has at least the parser model type
# if no other thing have been modified.
error_text = (
"You are not using the proper retrained checkpoint for Deepparse, since we also export other"
"informations along with the model weights. "
"You are not using the proper retrained checkpoint for Deepparse, since we also export other "
"information's along with the model weights. "
"When we retrain an AddressParser, by default, we create a "
"checkpoint name 'retrained_modeltype_address_parser.ckpt'. "
"Where 'modeltype' is the AddressParser model type (e.g. 'fasttext', 'bpemb'). "
Expand Down
24 changes: 12 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,25 +87,25 @@ def main():
long_description=readme,
long_description_content_type="text/markdown",
extras_require={
"colorama": "colorama>=0.4.3",
"app": ["fastapi[all]==0.99.1", "uvicorn==0.22.0", "sentry-sdk[fastapi]==1.28.1", "python-decouple==3.8"],
"colorama": "colorama",
"app": ["fastapi[all]>=0.109.1", "uvicorn==0.22.0", "sentry-sdk[fastapi]>=2.0.0", "python-decouple==3.8"],
"all": [
"colorama>=0.4.3", # colorama
"fastapi[all]==0.109.1", # app requirements
"colorama>", # colorama
"fastapi[all]>=0.109.1", # app requirements
"uvicorn==0.22.0",
"sentry-sdk[fastapi]>=1.28.1",
"sentry-sdk[fastapi]>=2.0.0",
"python-decouple==3.8",
"black", # code formatting requirements
"pylint==2.16.2",
"pylint",
"pylint-django[with_django]==2.5.3",
"pre-commit==3.3.3",
"pycountry==22.3.5", # tests requirements
"pytest==7.4.0",
"pytest-asyncio==0.21.1",
"pytest_cov==4.1.0",
"pytest-env==0.8.2",
"pytest-mock==3.11.1",
"pytest-xdist[psutil]==3.3.1",
"pytest",
"pytest-asyncio",
"pytest_cov",
"pytest-env",
"pytest-mock",
"pytest-xdist[psutil]",
"tensorboard==2.13.0",
"sphinx==6.2.1", # documentation requirements
"sphinx_rtd_theme==1.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,36 +35,6 @@ def test_givenAFasttextAddressParser_whenRetrain_thenTrainingOccur(self):

self.assertIsNotNone(performance_after_training)

@patch("deepparse.validations.poutyne")
def test_givenAnAddressParser_whenRetrainWithPoutyne17andBefore_thenTrainingOccurWithAWarningPrint(
self, poutyne_mock
):
poutyne_mock.version.__version__ = "1.7"
self._capture_output()
address_parser = AddressParser(
model_type=self.a_fasttext_model_type,
device=self.a_cpu_device,
verbose=self.verbose,
)

address_parser.retrain(
self.training_container,
train_ratio=self.a_train_ratio,
epochs=self.a_single_epoch,
batch_size=self.a_batch_size,
num_workers=self.a_number_of_workers,
logging_path=self.a_checkpoints_saving_dir,
)

actual = self.test_out.getvalue()

expected = (
"You are using a older version of Poutyne that does not support properly error management."
" Due to that, we cannot show retrain progress. To fix that, update Poutyne to the newest version.\n"
)

self.assertEqual(actual, expected)

@patch("deepparse.validations.poutyne")
def test_givenAnAddressParser_whenRetrainWithPoutyne18andAfter_thenTrainingOccurWithoutAWarningPrint(
self, poutyne_mock
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.10
0.9.11

0 comments on commit 4c12bb6

Please sign in to comment.