Commit Graph

403 Commits

Author SHA1 Message Date
Chih-Hsuan Yen
6002e273a9
Fix running on Python 3.8
Fix the following 2 errors when running on Python 3.8

```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/yen/Projects/nvchecker/nvchecker/main.py", line 33, in main
    if core.process_common_arguments(args):
  File "/home/yen/Projects/nvchecker/nvchecker/core.py", line 46, in process_common_arguments
    nicelogger.enable_pretty_logging(
  File "/home/yen/Projects/nvchecker/nvchecker/lib/nicelogger.py", line 93, in enable_pretty_logging
    formatter = TornadoLogFormatter(color=color)
  File "/home/yen/Projects/nvchecker/nvchecker/lib/nicelogger.py", line 16, in __init__
    super().__init__(self, *args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 589, in __init__
    self._style.validate()
  File "/usr/lib/python3.8/logging/__init__.py", line 441, in validate
    if not self.validation_pattern.search(self._fmt):
TypeError: expected string or bytes-like object
```

```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/yen/Projects/nvchecker/nvchecker/main.py", line 42, in main
    ioloop.run_until_complete(s.check())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 589, in run_until_complete
    return future.result()
  File "/home/yen/Projects/nvchecker/nvchecker/core.py", line 177, in check
    self.print_version_update(name, result)
  File "/home/yen/Projects/nvchecker/nvchecker/core.py", line 190, in print_version_update
    logger.info('updated', name=name, version=version, old_version=oldver)
  File "/home/yen/.local/lib/python3.8/site-packages/structlog/_base.py", line 191, in _proxy_to_logger
    args, kw = self._process_event(method_name, event, event_kw)
  File "/home/yen/.local/lib/python3.8/site-packages/structlog/_base.py", line 151, in _process_event
    event_dict = proc(self._logger, method_name, event_dict)
  File "/home/yen/Projects/nvchecker/nvchecker/slogconf.py", line 48, in stdlib_renderer
    getattr(logger, level)(
  File "/usr/lib/python3.8/logging/__init__.py", line 1441, in info
    self._log(INFO, msg, args, **kwargs)
  File "/usr/lib/python3.8/logging/__init__.py", line 1572, in _log
    fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
TypeError: findCaller() takes from 1 to 2 positional arguments but 3 were given
```

To fix the second issue, I backported relevant CPython changes [1] to slogconf.py

Test command: `python3.8 -c 'from nvchecker.main import main; main()' sample_source.ini`

[1] dde9fdbe45 (diff-c11fc567cf5b6e518eb855c23b5599bcR1400)
2018-12-26 11:39:23 +08:00
lilydjwg
77de8da557 make README look better 2018-12-16 14:17:58 +08:00
lilydjwg
13441ea88a 1.3 release, bump version 2018-12-16 13:30:10 +08:00
lilydjwg
d6067a3e86 add repology badge
thanks to @farseerfc
2018-12-16 13:28:40 +08:00
依云
377242f70b
Merge pull request #89 from yan12125/cache-vcs-by-name
Use the name as the fallback cache key for vcs packages
2018-12-16 13:24:37 +08:00
Chih-Hsuan Yen
0301155177
Use the name as the fallback cache key for vcs packages
Fixes #88
2018-12-15 21:45:11 +08:00
lilydjwg
5848aa39d9 travis-ci: fix pypy3, and python 3.7 works now 2018-12-05 17:14:46 +08:00
lilydjwg
b5fce0a3b9 tests: maybe newer pytest works now? 2018-12-05 16:46:23 +08:00
lilydjwg
eb75dc8305 Revert "tests: disable bitbucket tests because Travis-CI chooses the obsolete TLS 1.0 protocol"
This reverts commit 1da0e785db.

Trying other methods...
2018-12-05 16:38:45 +08:00
lilydjwg
5d3b5ed10c travis: use xenial 2018-12-05 16:38:09 +08:00
lilydjwg
1da0e785db tests: disable bitbucket tests because Travis-CI chooses the obsolete TLS 1.0 protocol 2018-12-05 16:34:57 +08:00
Chih-Hsuan Yen
6c6aff99b1
Workaround some pycurl.error issues
In my experiments, pycurl.error issues [1][2] do not appear if no 30x redirection involved.

Tested with https://github.com/tornadoweb/tornado/files/2624772/nv.log

[1] https://github.com/tornadoweb/tornado/issues/2542
[2] https://github.com/curl/curl/issues/3324
2018-12-04 22:23:04 +08:00
lilydjwg
5af558d214 tests: example.net certificate has expired, use http instead 2018-11-29 13:31:08 +08:00
Felix Yan
c1e5822f07
Handle graceful exit and timeout
Timeout was refactored and the defaults work correctly here.
2018-11-29 06:39:14 +08:00
Felix Yan
e3d62d4169
Ignore content type checking for aiohttp
Pass content_type=None as per the document suggests:

https://docs.aiohttp.org/en/stable/client_advanced.html#disabling-content-type-validation-for-json-responses
2018-11-29 06:37:47 +08:00
lilydjwg
c966e6faf8 vcs: allow the value to be None
This is a better fix for https://github.com/archlinuxcn/lilac/pull/91.
2018-11-24 12:18:39 +08:00
lilydjwg
d0ee359209 update tests and bump version to dev 2018-11-19 15:16:29 +08:00
lilydjwg
1adc38099a fix PyPI long_description display 2018-11-19 15:08:06 +08:00
lilydjwg
a6c3b49cc2 bump version to 1.2 2018-11-19 14:25:29 +08:00
lilydjwg
64703e8b2d tests: add test_cache 2018-10-10 17:35:18 +08:00
lilydjwg
e2fb91d3fb tests: fix clear_cache arg 2018-10-10 17:22:02 +08:00
lilydjwg
10e3478b12 fix test_keyfile
keyfile is not part of cache keys so the expectations are wrong.

We don't make it part of cache keys because we don't expect keyfile to
affect the version as long as we can get it.
2018-10-10 17:17:02 +08:00
lilydjwg
26eaef92aa handle deprecated warning, reindent conftest.py 2018-10-10 17:08:28 +08:00
lilydjwg
903b414183 cache result during a run
so that different entries can refer to a same software without much overhead.

This is needed because entries may be generated, and only nvchecker can
tell if two entries are expecting the same result because the name may
or may not be relevant.

Closes #81.
2018-10-10 17:03:20 +08:00
lilydjwg
8cc902909e update doc for AUR use_last_modified config 2018-09-30 19:51:55 +08:00
lilydjwg
faf14b64c4 Merge branch 'master' of github.com:lilydjwg/nvchecker 2018-09-30 19:50:27 +08:00
依云
0848d0a5d7
Merge pull request #82 from petronny/master
added use_last_modified for aur
2018-09-30 19:49:30 +08:00
Jingbei Li
ddbe30db8c added use_last_modified for aur 2018-09-30 17:42:42 +08:00
lilydjwg
b8812f4ae6 fix typo in comments 2018-09-27 21:40:21 +08:00
lilydjwg
81fb17ab25 nvtake: log for ignored names 2018-09-25 12:54:56 +08:00
lilydjwg
2d9bbadd15 add --ignore-nonexistent arg to nvtake 2018-09-25 12:36:17 +08:00
lilydjwg
033440da84 gitlab: fix rate limiting check 2018-09-25 12:33:37 +08:00
lilydjwg
9937378876 structlog PrintLogger doesn't have the 'fatal' synonym. 2018-09-22 21:27:17 +08:00
lilydjwg
60afa62d89 Revert "cache get_version results".
Some sources will use the name.

This reverts commits aabf9f5037
and f75a156d46.
2018-09-22 13:36:13 +08:00
lilydjwg
f75a156d46 fix get_version cache key 2018-09-22 13:28:59 +08:00
lilydjwg
aabf9f5037 cache get_version results
closes #81
2018-09-22 13:12:25 +08:00
lilydjwg
db376ccfed fix referring to wrong conf when logging no-result messages 2018-09-22 12:17:27 +08:00
lilydjwg
bfc4b76124 fix logging message module info pointing to structlog 2018-09-22 12:11:25 +08:00
lilydjwg
5bb2c960e5 declare that we support python 3.7 2018-09-21 19:41:42 +08:00
依云
68d9cd5d61
Merge pull request #80 from yan12125/add-missing_ok
Add missing ok
2018-09-21 16:10:58 +08:00
Chih-Hsuan Yen
e6d0449bc4
Fix tests 2018-09-21 12:18:21 +08:00
Chih-Hsuan Yen
1d16726c90
Add missing_ok, which suppresses no-result warnings 2018-09-21 12:17:21 +08:00
lilydjwg
42a02efec8 pytest 3.7.0 doesn't work with pytest-asyncio 0.9.0. pin to old pytest for now
Also see: https://github.com/pytest-dev/pytest-asyncio/issues/89
2018-08-01 16:41:19 +08:00
lilydjwg
0c459c1c03 Update README.rst about installation and running 2018-08-01 16:10:04 +08:00
lilydjwg
3e915a6a39 travis-ci: Python 3.7 isn't ready yet? 2018-07-22 23:17:16 +08:00
lilydjwg
431d80c61e test Python 3.7 2018-07-22 23:04:10 +08:00
lilydjwg
af368112ed Merge remote-tracking branch 'origin/pr/77' 2018-07-22 23:03:53 +08:00
lilydjwg
9f5028bbf0 tornado: set max_clients to 20
we'd better find out a way to specify this in the config file though.
2018-07-22 23:02:07 +08:00
Chih-Hsuan Yen
d9872dad6b Relax tornado requirement
I guess nobody is using tornado<4
2018-07-22 21:59:40 +08:00
Chih-Hsuan Yen
6afa9a551a Fix test_anitya 2018-07-22 21:08:00 +08:00