1
0
Fork 0
Commit Graph

1436 Commits (ad357cd69f48dd1ead38114102f93dc88e87c9d4)

Author SHA1 Message Date
debian ad357cd69f install notes 2020-01-12 15:34:34 -07:00
debian 06309646d8 fork 2020-01-12 12:37:59 -07:00
Fabian P. Schmidt 9bed67a4fd Migrate to Python 3
This also includes a refresh of the requirements after the Python3
transition.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-10 23:29:19 +02:00
Fabian P. Schmidt 2e906cfe31 CI: Add py3-pytest job
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-10 21:07:41 +02:00
Fabian P. Schmidt 257c3c2b84 tox: Add py3-pytest
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-10 21:07:27 +02:00
Fabian P. Schmidt 71af874944 Update 'celery' and dependencies for Python 3.7+ support
Python 3.7 is supported from 'celery' version 4.3 upwards,
previous versions were hit by the following bug:
https://github.com/celery/celery/issues/4500

Similar commit in db: librespacefoundation/satnogs/satnogs-db@dc06369f

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-10 21:06:57 +02:00
Alfredos-Panagiotis Damkalis a83a707de2 migrations: Replace bytes with string literals
Missing changes from previous commit.

Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-10 20:07:31 +02:00
Alfredos-Panagiotis Damkalis 9bf43438d2 utils/export_as_csv: fix encoding for csv writer
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-09 01:12:37 +02:00
Fabian P. Schmidt a6de5b44f9 {api/views.py|base/models.py}: Disable false-positive no-member pylint errors (E1101)
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:17:08 +01:00
Fabian P. Schmidt ec73abeaa7 migrations: Replace bytes with string literals
As long as the bytes literal contains only ASCII data it can be replaced
with a string literal already in Python 2.
https://docs.djangoproject.com/en/1.11/topics/python3/#unicode-literals

The following command was used to generate this patch:
```
sed -i "s/b'\([\x00-\x7F]*\)'/'\1'/g" network/base/migrations/*
```

Similar commit in db: librespacefoundation/satnogs/satnogs-db@f0c0c9bc

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:16:15 +01:00
Fabian P. Schmidt e386eb658d Add comments for missing atttributes in ephem.Observer class slots (E0237)
Fixes assigning-non-slot (E0237) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:04:26 +01:00
Fabian P. Schmidt 02eda83a84 utils/export_as_csv: Catch more-specific TypeError instead of broad Exception (W0703)
Fixes the broad-except (W0703) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:02:23 +01:00
Fabian P. Schmidt 4c9cd66661 models/Observation: Improve requests exception handling (W0703)
Fixes a broad-except (W0703) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:01:49 +01:00
Fabian P. Schmidt caa861b187 forms/BaseObservationFormSet: Add missing initialization of member variable (W0201)
Fixes the attribute-defined-outside-init (W0201) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:00:51 +01:00
Fabian P. Schmidt fbabd125ad views/ObservationListView: Add missing initialization of member variable (W0201)
Fixes an attribute-defined-outside-init (W0201) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:00:34 +01:00
Fabian P. Schmidt 86c6e6b63b api/serializers: Add missing inizialization (W0201)
Fixes an attribute-defined-outside-init (W0201) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:00:34 +01:00
Fabian P. Schmidt 781097da40 test_utils: Add missing docstrings (C0111)
Fixes missing-docstring (C0111) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 17:58:30 +01:00
Fabian P. Schmidt acb26329c5 test_utils: Locally disable redefined-outer-name pylint error (W0621)
This pylint error is in contradiction with pytest using the argument
name to detect which fixture should be passed to the test method.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 17:58:28 +01:00
Fabian P. Schmidt 1212dd6cfd utils/community_get_discussion_details: Re-use existing formatstring argument (W1308)
Fixes duplicate-string-formatting-argument (W1308) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 17:56:09 +01:00
Fabian P. Schmidt 7b421894d3 pylint: Re-Enable all non-failing python3 pylint checks
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 17:46:21 +01:00
Fabian P. Schmidt 7471f8567f Remove unncessary pass statements in empty classes with docstring (W0107)
Fixes unnecessary-pass (W0107) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 15:26:42 +00:00
Fabian P. Schmidt 903b264814 management/commands/fetch_data: Locally disable redefined-builtin pylint error (W0622)
In Python 3.3 ConnectionError was added as subclass in python builtins,
see PEP3151 or [1] for more details.

[1]: https://docs.python.org/3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy

Fixes redefined-builtin (W0622) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 15:17:33 +00:00
Fabian P. Schmidt 283b994a67 admin/AntennaAdmin: Replace __unicode__ by __str__ in list_display
__unicode__ was removed in Python 3.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 15:05:34 +00:00
Fabian P. Schmidt 7443d76a2f users/models: Replace __unicode__ by __str__ (W5102)
The special method __unicode__ is python2-only,
in python3 it's merged with __str__. In order to be py23-compatible
the python_2_unicode_compatible decorator is used, see
https://docs.djangoproject.com/en/1.11/topics/python3/#str-and-unicode-methods

Equivalent commit in db: librespacefoundation/satnogs/satnogs-db@9a0ef30e
Equivalent commit for base model: d20943ce

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 14:45:51 +00:00
Fabian P. Schmidt aa0b657de1 commands/update_station_last_seen: Rename unused argument to original specifier (W0613)
Fixes unused-argument (W0613) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-05 00:25:19 +01:00
Fabian P. Schmidt 183dade977 CI: Add static python3 job
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 20:41:12 +01:00
Fabian P. Schmidt 7412376ec5 pylint: Disable all failing python3 pylint errors
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 20:41:12 +01:00
Fabian P. Schmidt 538ea52c1a tasks/clean_observations: Fix premature task termination in 'stage' environment
Skip the archival of old observations which just got deleted instead
of terminating the whole task at this point.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 19:46:06 +01:00
Alfredos-Panagiotis Damkalis 1635a14640 Retry archive.org uploading on "SlowDown" error
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-04 18:22:17 +02:00
Fabian P. Schmidt e1ed302e64 utils/drifted_frq: Use python3 round builtin (W1633)
This changes the used rounding strategy.

See "Whats new in python3"[1] for more details:
> Exact halfway cases are now rounded to the nearest even result
> instead of away from zero.
> (For example, round(2.5) now returns 2 rather than 3.)

Fixes round-builtin (W1633) pylint error.

[1]: https://docs.python.org/3/whatsnew/3.0.html#builtins

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:31:05 +01:00
Fabian P. Schmidt af9f9bf8e9 api/serializers: Use integer literal instead of pow
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:30:49 +01:00
Fabian P. Schmidt 0203ab17a7 templatetags/tags: Use integer literal instead of pow
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:30:49 +01:00
Fabian P. Schmidt 11df29ba1d views: Use str builtin instead of single-argument formatstring
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:07:06 +01:00
Fabian P. Schmidt 1719473d70 Use str(error) instead of error.message (W1645)
Fixes exception-message-attribute (W1645) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:07:06 +01:00
Fabian P. Schmidt 6ed02d4dd9 scheduling/create_new_observation: Add verbose docstring
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:55:12 +00:00
Fabian P. Schmidt 642a0a2c61 Add from __future__ import division to all relevant files (W1619)
Fixes old-divison (W1619) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:55:12 +00:00
Fabian P. Schmidt a7692b4627 base/scheduling: Make division operations "true division"-safe
Use explicit typecast to float to prevent ambiguous division operation
in the first two cases. In the last case (timdelta, int), the python2
timedelta doesn't support the division operator (this was intruduced
in python 3.2). Use old_div instead.

This change clarifies that true division is the desired behaviour
in these three code locations.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:55:12 +00:00
Fabian P. Schmidt f774025a6f utils/sync_demoddata_to_db: Raise RequestException if sync fails (W0703)
Let the caller handle the exception in case the sync fails.

Fixes a broad-except (W0703) pylint error.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 14:08:00 +01:00
Fabian P. Schmidt 426e3585f8 utils/sync_demoddata_to_db: Use requests instead of urllib2 (W1648, W1658)
Fixes the bad-python3-import (W1648) and deprecated-urllib-function (W1658) pylint errors.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:55:31 +01:00
Fabian P. Schmidt 575ecc739b settings: Add DB_API_TIMEOUT
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:36:41 +01:00
Alfredos-Panagiotis Damkalis bd9a37dd50 Fix lint issues of the latest commits
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-03 19:01:57 +02:00
Alfredos-Panagiotis Damkalis ee8fe283cb Change tox to run py2-lint with and without --py3k flag
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-03 19:00:56 +02:00
Alfredos-Panagiotis Damkalis c9d4686f07 Revert "pylint: enable E1121, R0912, R0913, R0914, W0201 and W0703 checks"
This reverts commit 581fc7620c. pylint didn't
check the enabled checks as was run with --py3k parameter.

Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-03 16:03:46 +02:00
Alfredos-Panagiotis Damkalis 581fc7620c pylint: enable E1121, R0912, R0913, R0914, W0201 and W0703 checks
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-03 14:03:18 +02:00
Fabian P. Schmidt a026edd36a utils/sync_demoddata_to_db: Fix method rename from display_payload to display_payload_hex
Fixes #702 (regression introduced in 3609e46b).

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 20:50:18 +01:00
Fabian P. Schmidt 834c7b67fe management/fetch_data: Re-use fetch_data task
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 14:38:54 +00:00
Fabian P. Schmidt 8993d7e1b1 settings: Add comment on DB_API_ENDPOINT usage
This feature (disable DB data fetching by setting DB_API_ENDPOINT to '')
was added in b522d43, but never documented.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 14:38:53 +00:00
Fabian P. Schmidt bda0580dbe utils/community_get_discussion_details: Add a sane request timeout
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 14:28:07 +00:00
Fabian P. Schmidt dd54caa4e4 utils/community_get_discussion_details: Fix response when commnuity is unreachable
Fixes #700 (regression introduced by 10b1292).

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 14:28:07 +00:00
Fabian P. Schmidt 3609e46b78 Fix demod data display for utf-8 decodable non-CW observations (W1612)
Previously for unicode decode-able frames in observations where the transmitter
type was not CW, the hex dump was malformed and contained the unicode decoded
text instead.

Fixes the unicode-builtin (W1612) pylint errors as well.

Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 13:26:47 +01:00