1
0
Fork 0
Commit Graph

746 Commits (master)

Author SHA1 Message Date
Vasilis Tsiligiannis bea4b1c9a1 gitlab-ci: Use Alpine image defined in variables to deploy pages
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-09-17 22:12:07 +03:00
Corey Shields 3e24773476 fix reverted mode_label and mode_data
when linting db code I unintentionally swapped the return of mode_data with mode_label, causing NaN in stats.js when trying to calculate the mode doughnut.

Reverts this bug.  Fixes #325

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-09-01 19:53:03 -04:00
Vasilis Tsiligiannis f5e95c7af7 tox: Substitute package versions from 'depversions' section
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-09-02 02:22:15 +03:00
Vasilis Tsiligiannis fc90760e7c pylint: Remove W0603 warning on 'args' and 'kwargs', remove unused Python 2 configuration
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-09-02 01:49:51 +03:00
Vasilis Tsiligiannis 70ad7ed3de gitlab-ci: Keep Docker images and Python packages in variables
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-09-02 01:36:11 +03:00
Vasilis Tsiligiannis 572ac24d44 tox: Assume that Python 3 is the default interpreter
This change affects existing development environments which will have
to be recreated with the Python 3 interpreter as the default.

Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-09-02 01:12:18 +03:00
Vasilis Tsiligiannis b288a1249d gitlab-ci: Fix typo in variable reference
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-09-02 00:23:52 +03:00
Vasilis Tsiligiannis 18e377cad5 Remove old, unused Dockerfile for testing
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-09-02 00:07:38 +03:00
Corey Shields 45cf720f99 Merge branch 'py3' 2019-09-01 15:12:17 -04:00
Corey Shields cacef2a91e python3 - finally
Switch from python2 to python3 container

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-09-01 13:02:28 -04:00
muarachmann c01cdb1aa7 Removed backbone js dependency from satnogs-db
Signed-off-by: Mua N. Laurent <muarachmann@gmail.com>
2019-08-28 16:32:41 +01:00
Corey Shields 61f9137aae Fix celery cyclical dependency
Fixes the cyclical dependency between celery.py and tasks.py when update_all_tle is called outside of celery by switching to autodiscovered tasks

Signed-off-by: Corey Shields <cshields@gmail.com>
[acinonyx@openwrt.gr: use @shared_task decorator and wrapper tasks to workaround celery bug]
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-08-19 01:13:28 +03:00
Corey Shields 6920bbab03 move py2 lint exceptions to .pylintrc
Ignore py2-specific linting errors in .pylintrc while testing them in .pylintrc3

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-08-10 15:53:00 -04:00
Corey Shields f80f207c78 Flake and isort fixes
Fix some spacing issues and import syntax introduced by my linting changes.

The inline pylint disable for C0412 clashes with isort, there is no combination there that works for both.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 15:55:20 -04:00
Corey Shields f1420d3e9e Linting W0511
part of W0511

Filed #321 and moved code comments to #265

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 15:38:02 -04:00
Corey Shields d71114130a Rename transmitter properties
Fixing these as part of W0511

There were some transmitter properties labeled "has_" (which implies a boolean) while returning a count. Renamed them and their instances to "_count" along with cleaning up some variables

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 15:24:42 -04:00
Corey Shields 40460c47bb Linting for W0511
Moved these placeholders to issues #319 and #320

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 15:23:26 -04:00
Corey Shields fc8f9a8c35 Linting for C0412
There are clashes between the positioning and ordering of our imports between pylint and isort, just ignoring them on the pylint side for now..

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 14:45:19 -04:00
Corey Shields 9359532df9 Linting for E1101
Pylint throws 2 false positives for E1101 under Python2 (but runs cleanly in Python3). Disabling these.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 14:29:24 -04:00
Corey Shields f9336eb0b4 Linting for R0401
Fixes a cyclical dependency between calling the celery app through an import in tasks.py (which then imports tasks.py) by retrieving celery through the class.

Tested in local dev

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 14:17:16 -04:00
Corey Shields b0bfe0eea7 Keep R0801 disabled
R0801 trips on our norad argument handling in fetch_satellites.py and delete_satellite.py - but there is no way to disable it locally due to a bug.  See https://github.com/PyCQA/pylint/issues/214

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 12:41:29 -04:00
Corey Shields 8271351729 Linting for R0901
Ignoring cases of too many ancestors in API views.py as these are upstream, not much we can do about it.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 12:22:41 -04:00
Corey Shields 91d8ba20bd Linting for R0903
Ignoring R0903 for tests.py where we do not need to care about public methods, and for django managers in models.py

This negates the need for MR !396

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 12:13:56 -04:00
Corey Shields b704454486 Linting for R0914
A couple of functions in tasks and utils were refactored with new helper functions to reduce the number of local variables per function.

In addition, fetch_data.py was flagged with R0914 but this is a relic of the original attempt at decoding data into DB, and is unused - so I am removing rather than fixing it.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-27 12:10:47 -04:00
deckbsd 965a4f3658 add filters on satnogs db telemetry api
remove unset schema filter

fix flake8 remark

Signed-off-by: flawinne julien  <deckbsd@protonmail.com>
2019-07-20 07:31:24 -07:00
Vasilis Tsiligiannis 70ffe07f22 Reduce number of statements, resolve pylint 'R0915'
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:52:35 +03:00
Vasilis Tsiligiannis 5abb3553f9 Do not call return in 'if' and 'else'
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:52:10 +03:00
Vasilis Tsiligiannis 26662074e5 isort: Declare 'factory' as a third-party import
* Apply changes based on new configuration
* Enable 'C0411' pylint checking

Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:51:53 +03:00
Vasilis Tsiligiannis 3404db012c Move form validation function out of class, fix 'E0213' pylint error
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:51:48 +03:00
Vasilis Tsiligiannis ddccf3146e pylint: Enable 'E1101' check for Python 3
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:51:01 +03:00
Vasilis Tsiligiannis f2538355ab pylint: Use separate configuration file for Python 2 and Python 3
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
2019-07-17 17:50:52 +03:00
Corey Shields f6e61f158f review fixes for !393
per acinonyx review, fix comment spacing, add missing citation to TransmitterEntryForm, and standardize pylint disable messages

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-17 09:26:13 -04:00
Corey Shields 3596ebfb9f flake / lint fixes
Signed-off-by: Corey Shields <cshields@gmail.com>

Fix some spacing issues brought up in a full tox run (that were not identified in my prior linting flows)
2019-07-17 09:26:13 -04:00
Corey Shields 9989efb453 linting for R0201
Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 19:12:54 -04:00
Corey Shields 3ce647e374 linting R0101
too-many-nested-blocks - pulled a break point out for utils.py/decode_data to get rid of a nested block

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 18:49:18 -04:00
Corey Shields 389194b076 linting W5104
using field excludes is an antipattern and a possible security risk down the road. Replaced with explicit fields list.
2019-07-13 18:42:11 -04:00
Corey Shields c376e08826 linting W5102, W5103
Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 18:33:03 -04:00
Corey Shields adfc08bb79 linting W1201, W1202
fix logging strings to %s format

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 18:15:13 -04:00
Corey Shields 6bc64e9217 linting for W0703
broad-except, I added explicit exceptions where I felt safe doing so - but we do have a lot of broad exceptions accepted.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 18:08:55 -04:00
Corey Shields fe1f989d7b linting for W0621
resolving name conflicts between variables and functions

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 17:38:04 -04:00
Corey Shields 0d4701b100 linting W0612, W0613
Mostly disabling the alerts on django signals and filter attributes that go unused.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 16:24:43 -04:00
Corey Shields f7c4df84f1 Fix broken API filter view
Linting W0613 led to the discovery that we filter on status entries that do not exist. Changing "functional" to "active" will fix https://db.satnogs.org/api/transmitters/?alive=true

fixes satnogs-db#298

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 16:14:40 -04:00
Corey Shields 0da7589c1d fix spacing (flake)
Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 16:02:48 -04:00
Corey Shields fca0c1d419 Linting W0223
We were missing a call to return the login page from a BaseAuth abstract function.

Once this is in dev (an auth0 environment) I suspect it might fix librespacefoundation/satnogs/satnogs-db#309

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 15:40:28 -04:00
Corey Shields 678de105dd linting W0201 and W0221
we are going to ignore W0201 and W0221 around the TransmitterEntry save function. Reasons are in the code comments.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 15:32:04 -04:00
Corey Shields ec07c59263 linting for W0150
the check_celery function returns in a finally, which is unnecessary and is an antipattern. This works just the same dropping the finally statement and returning in the end.

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 14:46:16 -04:00
Corey Shields a8a0dc4aa6 linting W0107
check_celery had an invalid pass, replaced that with a log entry.
 
Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 14:38:20 -04:00
Corey Shields 8b6410ba2c W0105 linting - remove display_decoded
display_decoded is an unused relic of the original decode method, and throws a W0105 warning.

removing this function completely

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-13 14:28:04 -04:00
Corey Shields f90fe277d5 remove unused helpers
cleaning up C0111 exposed that we have some helpers initially added when django cache was implemented, but have since been abandoned.

Removing them as they are unused and unneeded

Signed-off-by: Corey Shields <cshields@gmail.com>
2019-07-12 22:53:23 -04:00
Corey Shields 2ec2fd2a4d pylint C0111 docstrings
phew, fixed all of the missing-docstring and found some other things along the way (for future changes)
2019-07-12 22:36:18 -04:00