Commit Graph

13 Commits

Author SHA1 Message Date
Laurent Monin
45a6b20b85 Introduce picard.api_versions_tuple
- list of versions as tuples
- constant calculated from picard.api_versions
- add tests
- skip tests if not enough elements (previous code didn't make sense anyway)
2019-04-18 11:14:45 +02:00
Laurent Monin
b7203e4280 Docstrings should use triple double quotes (PEP257)
https://www.python.org/dev/peps/pep-0257/#id15

For consistency, always use """triple double quotes""" around docstrings.
2018-12-16 16:54:37 +01:00
Philipp Wolfer
2603e6286c Fixed test_api_versions test 2018-11-11 12:08:41 +01:00
Wieland Hoffmann
e624aa121c Make PicardTestCase the parent class of all tests
This brings the faketagger and, more importantly, settings reset to all of them.
2018-10-23 17:32:50 +02:00
Laurent Monin
5329e3592a Clean up and sort imports using isort
Add a config for isort (https://github.com/timothycrosley/isort)
Run isort -rc . and make import style consistent across files
Add a note about `isort` in CONTRIBUTING.md
2018-08-22 08:51:25 +02:00
Sambhav Kothari
93c46dbce8 Update version_to_string to follow PEP440 2017-05-09 14:53:30 +05:30
Laurent Monin
a3b0e21290 Improve API versions list test
- fix typo in method name
- make comment more explicit
- test the case where only one element is in the list
- ignore 0 element case (should test skip(), but 2.6 lacks it)
2014-04-26 12:08:02 +02:00
Laurent Monin
d7ba54dc51 Make version_to_string() and version_from_string() more tolerant
With those changes they can be used to parse plugin API versions too.

Test cases were modified accordingly.

Main changes:
```python
>>> version_from_string("1.0")
(1, 0, 0, 'final', 0)
>>> version_from_string("1.0.1")
(1, 0, 1, 'final', 0)
```
2014-04-25 12:01:47 +02:00
Laurent Monin
c2d53a4d4d version_from_string(): match end of the string instead full string 2014-01-02 17:32:34 +01:00
Laurent Monin
6e889ca0a0 Use exceptions in place of assertions -> VersionError 2014-01-02 17:28:41 +01:00
Laurent Monin
81ec25afcd Make version_from_string() more tolerant 2014-01-02 11:50:51 +01:00
Laurent Monin
4554898e42 version_to_string(): be smarter and accept list with strings 2013-12-31 15:31:12 +01:00
Laurent Monin
97f00b2d29 Handle configuration file versions.
version_info was renamed PICARD_VERSION
version_string was renamed PICARD_VERSION_STR
short version string is stored in PICARD_VERSION_STR_SHORT (for display)

Hooks can be created to handle upgrades (ie. options renaming), see config.register_upgrade_hook() and config.run_upgrade_hooks()
2013-07-02 01:45:25 +02:00