Repository navigation
Conversation
Add test with various locale Add test with datetime.date Closes biopython#4972
bryan-brancotte
force-pushed
the
genbank-date-locale-independent-and-warning
branch
from
March 21, 2025 11:20
82a6422 to
886fe9f
Compare
Contributor
Author
|
The tests try using various locale, which are not by default in ubuntu-latest, and thus wont be tested in the CI, while they will be tested on a local computer if locale is installed manually. We can add it to the CI, but it add 30MB of download, some more time. I don't know what one would prefer diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 82f5f7626..84c9493ad 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -55,6 +55,14 @@ jobs:
run: |
pre-commit run --files ${{ steps.changed-files.outputs.all_changed_files }}
+ - name: Install locale
+ run: |
+ sudo apt-get update
+ echo "fr_FR.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
+ echo "de_DE.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
+ echo "pt_BR.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
+ sudo apt-get -y install locales
+
# Cache pip & python dependencies for Linux runner
# since it is used in most actions.
# Adapted from: https://medium.com/ai2-blog/python-caching-in-github-actions-e9452698e98dP.S: diff not tested |
peterjc
requested changes
Mar 21, 2025
peterjc
left a comment
Member
There was a problem hiding this comment.
I wouldn't install the extra locales in the CI just for this test - the overhead seems excessive.
peterjc
reviewed
Mar 21, 2025
peterjc
reviewed
Mar 21, 2025
peterjc
enabled auto-merge (squash)
March 21, 2025 15:35
peterjc
approved these changes
Mar 21, 2025
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4977 +/- ##
==========================================
+ Coverage 85.37% 86.27% +0.90%
==========================================
Files 282 282
Lines 59397 59399 +2
==========================================
+ Hits 50708 51246 +538
+ Misses 8689 8153 -536 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I hereby agree to dual licence this and any previous contributions under both
the Biopython License Agreement AND the BSD 3-Clause License.
I have read the
CONTRIBUTING.rstfile, have runpre-commitlocally, and understand that continuous integration checks will be used to
confirm the Biopython unit tests and style checks pass with these changes.
I have added my name to the alphabetical contributors listings in the files
NEWS.rstandCONTRIB.rstas part of this pull request, am listedalready, or do not wish to be listed. (This acknowledgement is optional.)
Locale independent date serialization when writing GenBank file. Also added support for datetime.date.
Added test with various local known to make the former serialization fail (when available).
Show a warning when writing a file with an invalide date format
Closes #4972