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

v0.11.0.rc2: Widespread code reorganization (much more separation of concerns) #96

Merged
merged 13 commits into from
Mar 27, 2018

Conversation

sushain97
Copy link
Member

@sushain97 sushain97 commented Mar 26, 2018

  • move almost all handlers into separate files in apertium_apy.handlers. the problem with bunching them up into more than one per file is then they become undiscoverable or file names would become super long/contrived (fixes Refactor apy.py handlers into multiple files #95)
  • move all the utils into a folder with separate files
  • convert all relative imports to absolute
  • remove all the useless shebangs (those files never get run directly...)
  • run branch coverage (this lowered coverage, naturally)
  • add more basic tests to verify I haven't broken anything
  • consider moving some of the other top level py files in apertium_apy. maybe into tools?
  • consider replacing some of the re parsing with streamparser (will require it for more endpoints) (Replace all re streamparsing with streamparser calls #98)
  • add debug flag to enable pipe debug, translate raw, etc. they shouldn't really be enabled on e.g. apertium.org (Hide some modes (pipe debug, translate raw, etc.) under a debug flag #97)
  • split tests into separate files (Split tests into multiple files #100)
  • consistent string formatting (linter?) this would take a lot of changes for not that much value

@coveralls
Copy link

coveralls commented Mar 26, 2018

Pull Request Test Coverage Report for Build 763

  • 591 of 1106 (53.44%) changed or added relevant lines in 25 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+4.5%) to 41.292%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apertium_apy/utils/wiki.py 0 2 0.0%
apertium_apy/handlers/stats.py 20 23 86.96%
apertium_apy/apy.py 16 20 80.0%
apertium_apy/handlers/list_modes.py 24 31 77.42%
apertium_apy/handlers/translate_raw.py 6 18 33.33%
apertium_apy/handlers/base.py 109 122 89.34%
apertium_apy/handlers/list_language_names.py 49 64 76.56%
apertium_apy/gateway.py 0 16 0.0%
apertium_apy/handlers/pipe_debug.py 6 23 26.09%
apertium_apy/handlers/identify_lang.py 10 29 34.48%
Files with Coverage Reduction New Missed Lines %
apertium_apy/apy.py 1 56.54%
Totals Coverage Status
Change from base Build 735: 4.5%
Covered Lines: 967
Relevant Lines: 2096

💛 - Coveralls

@sushain97
Copy link
Member Author

Writing one of the tests uncovered two bugs \o/ (one an artifact from my last refactoring and one a bug that's been sitting around for who knows how long).

@sushain97 sushain97 merged commit 037d44d into master Mar 27, 2018
@sushain97
Copy link
Member Author

sushain97 commented Mar 27, 2018

Merged and released as rc2. Final rc will be rc3 and only planned changes are increased test coverage/test organization.

@sushain97 sushain97 deleted the issue-95 branch March 27, 2018 05:38
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.

Refactor apy.py handlers into multiple files
3 participants