ppannuto / python-titlecase

Python library to capitalize strings as specified by the New York Times Manual of Style
MIT License
249 stars 38 forks source link

CI test re and regex #84

Closed brocksam closed 3 years ago

brocksam commented 3 years ago

This PR:

* This PR is a work-in-progress and should not be reviewed/merged until the "WIP" label is removed.

brocksam commented 3 years ago

This PR now supersedes #83 as it also fixes #82 while continuing support for regex without logic modification. I believe #83 should now be closed and this PR (#84) merge in preference. Huge thanks goes to @fireundubh for doing the hard work in tracking down the correct regular expression syntax to replace \p{Letter} etc. using only re.

The tests have been shown to pass both using re and using regex, see: https://github.com/brocksam/python-titlecase/actions/runs/942315378.

This PR is no longer WIP.

ppannuto commented 3 years ago

Thank you so much @brocksam and @fireundubh for the quick fixes here! I'm sorry that things broke upstream for folks :/.

It looks like the CI infrastructure needs some refinement with the changes in Travis; I'll probably try to move everything over to github actions, thank you for the start!, but given the breakages, I've run tests on these locally and all seemed to work, so I'll kick out a fresh point release now with these fixes.

fireundubh commented 3 years ago

Nice work, @brocksam. Thanks for going the extra mile with all the package updates, too.

The test_custom_abbreviations test, however, is broken again.

======================================================================
ERROR: titlecase.tests.test_custom_abbreviations
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\.virtualenvs\python-titlecase\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "F:\repos\python-titlecase\titlecase\tests.py", line 383, in test_custom_abbreviations
    assert titlecase('sending UDP packets over PPPoE works great', callback=create_wordlist_filter_from_file(f.name)) == 'Sending UDP Packets Over PPPoE Works Great'
  File "F:\repos\python-titlecase\titlecase\__init__.py", line 216, in create_wordlist_filter_from_file
    with open(file_path_str) as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\FIREUN~1\\AppData\\Local\\Temp\\tmpiy39ocyp'
-------------------- >> begin captured logging << --------------------
titlecase: DEBUG: Sending UDP Packets Over PPPoE Works Great
titlecase: DEBUG: Sending Udp Packets Over Pppoe Works Great
--------------------- >> end captured logging << ---------------------
brocksam commented 3 years ago

@fireundubh can you (re)open an issue for this please? And then we can discuss fixing.