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

Dev Tool Updates #379

Merged
merged 48 commits into from
Oct 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6b5a779
Port tests to pytest
MJJoyce Sep 21, 2021
f43a156
Drop nose from setup.cfg
MJJoyce Sep 21, 2021
2414dff
Drop custom git hook install in prep for pre-commit changes
MJJoyce Sep 21, 2021
cf506e5
Drop pylint and pep-related config
MJJoyce Sep 21, 2021
6919de8
Update optional package install handling and add new depdencies
MJJoyce Sep 21, 2021
9a648fd
final nose removal cleanup
MJJoyce Sep 21, 2021
2834d47
Run black across codebase
MJJoyce Sep 21, 2021
7a7e3bf
minor nose->pytest cleanup
MJJoyce Sep 21, 2021
7939298
More black cleanup
MJJoyce Sep 22, 2021
4573211
Initial pre-commit additions and cleanup. mypy compatibility fixes
MJJoyce Sep 22, 2021
390f223
Add flake8 exclusions for module level import errors
MJJoyce Sep 22, 2021
20aeb70
Fix linting errors in API module
MJJoyce Sep 22, 2021
9277ed2
Fix linting errors in bsc module
MJJoyce Sep 22, 2021
093d26b
Fix linting errors in cmd module
MJJoyce Sep 22, 2021
3abd4d9
Fix linting errors in coord module
MJJoyce Sep 22, 2021
511fa7e
Revert testdata changes
MJJoyce Sep 22, 2021
89d38b5
Fix linting errors in db module
MJJoyce Sep 22, 2021
61fbf57
Fix linting errors in dmc module
MJJoyce Sep 22, 2021
22f2efb
Fix linting errors in dtype module.
MJJoyce Sep 22, 2021
a2b0013
Fix linting errors in evr module
MJJoyce Sep 22, 2021
8bb3ffa
Fix linting errors in gds module
MJJoyce Sep 22, 2021
e805c64
Fix linting errors in geom module
MJJoyce Sep 22, 2021
23d3076
Fix linting erros in json module
MJJoyce Sep 22, 2021
c5158d4
Fix linting errors in limits module
MJJoyce Sep 22, 2021
4768a7e
Add tag files to .gitignore
MJJoyce Sep 22, 2021
9baf9ea
Fix linting errors in log module
MJJoyce Sep 22, 2021
e0151e3
Fix linting errors in pcap module
MJJoyce Sep 22, 2021
8f0b17f
Fix linting errors in seq module
MJJoyce Sep 22, 2021
63e6502
Fix linting errors in table module
MJJoyce Sep 22, 2021
c5ae415
Fix linting errors in tlm module.
MJJoyce Sep 22, 2021
526b5f4
Fix linting errors in util module
MJJoyce Sep 22, 2021
896efd5
Fix linting errors in val module
MJJoyce Sep 22, 2021
d557cef
Linting related cleanup
MJJoyce Sep 22, 2021
2820f1d
Additional cfg.py module linting cleanup
MJJoyce Sep 29, 2021
92a1f65
core.__init__ linting error cleanup
MJJoyce Sep 29, 2021
3cbd17d
Cleanup server.__init__ linting errors
MJJoyce Sep 29, 2021
8f30508
server.plugins.__init__ linting error cleanup
MJJoyce Sep 29, 2021
75a9826
server.handlers.__init__ linting error cleanup
MJJoyce Sep 29, 2021
7e5c646
Clean up server.broker linting errors
MJJoyce Sep 29, 2021
9bf5c51
Cleanup server.server linting errors
MJJoyce Sep 29, 2021
fb0a137
Cleanup linting errors in server.stream
MJJoyce Sep 29, 2021
a67a88c
Cleanup server.plugins.data_archive linting errors
MJJoyce Sep 29, 2021
688ead2
Cleanup server.plugin linting errors
MJJoyce Sep 29, 2021
7c0e38b
Clean up server.utils linting errors
MJJoyce Oct 1, 2021
42b6539
Additional Core server linting fixes
MJJoyce Oct 4, 2021
b458412
bin script linting error cleanup
MJJoyce Oct 5, 2021
ce725b5
Additional mypy related updates and cleanup for full pipeline check
MJJoyce Oct 26, 2021
aec5df4
Add tox support and rearrange test structuring
MJJoyce Oct 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Distribution / Packaging / Build files
.coverage
.coverage*
doc/build/*
doc/source/ait.core.test*
doc/source/ait.core.server.test*
build/lib/*
*.egg-info/
*.egg
.tox

# Object Files
*.o
Expand Down Expand Up @@ -40,6 +41,7 @@ src/doc/dict/cmd/cmddict-07-cmddefs.tex

# Temporary files
*~
tags*

# Unignore (hack)
!build/clean.py
Expand Down
85 changes: 85 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: debug-statements

- repo: https://github.com/asottile/reorder_python_imports
rev: v2.6.0
hooks:
- id: reorder-python-imports
files: ^src/|test/

- repo: local
hooks:
- id: mypy
name: mypy
entry: mypy ait
language: system
pass_filenames: false
exclude: "bin/"

- repo: local
hooks:
- id: black
name: black
entry: black
files: ^src/|test/
language: system
types: [python]

- repo: local
hooks:
- id: flake8
name: flake8
entry: flake8 ait
language: system
pass_filenames: false

- repo: local
hooks:
- id: tlm_yaml_check
name: AIT TLM YAML check
entry: 'ait-yaml-validate --tlm'
language: system
stages: [push]
pass_filenames: false

- repo: local
hooks:
- id: cmd_yaml_check
name: AIT CMD YAML check
entry: 'ait-yaml-validate --cmd'
language: system
stages: [push]
pass_filenames: false

- repo: local
hooks:
- id: evr_yaml_check
name: AIT EVR YAML check
entry: 'ait-yaml-validate --evr'
language: system
stages: [push]
pass_filenames: false

- repo: local
hooks:
- id: limits_yaml_check
name: AIT LIMITS YAML check
entry: 'ait-yaml-validate --limits'
language: system
stages: [push]
pass_filenames: false

- repo: local
hooks:
- id: tests
name: Tests
entry: pytest
language: system
stages: [push]
pass_filenames: false
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include ait/core/data/*.json
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The AMMOS Instrument Toolkit (Formerly the Bespoke Links to Instruments
for Surface and Space (BLISS)) is a Python-based software suite
developed to handle Ground Data System (GDS), Electronic Ground Support
Equipment (EGSE), commanding, telemetry uplink/downlink, and sequencing
for instrument and CubeSat Missions. It is a generalization and expansion
for instrument and CubeSat Missions. It is a generalization and expansion
of tools developed for a number of ISS
missions.

Expand Down Expand Up @@ -39,7 +39,7 @@ Guide <https://github.com/NASA-AMMOS/AIT-Core/wiki/Contributing>`__.
|docs|

.. |travis| image:: https://travis-ci.com/NASA-AMMOS/AIT-Core.svg?branch=master
:target: https://travis-ci.com/NASA-AMMOS/AIT-Core
:target: https://travis-ci.com/NASA-AMMOS/AIT-Core

.. |docs| image:: https://readthedocs.org/projects/ait-core/badge/?version=master
:alt: Documentation Status
Expand Down
2 changes: 1 addition & 1 deletion ait/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
# or other export authority as may be required before exporting such
# information to foreign countries or providing access to foreign persons.

__import__('pkg_resources').declare_namespace(__name__)
__import__("pkg_resources").declare_namespace(__name__)
39 changes: 21 additions & 18 deletions ait/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,34 @@

import sys

from ait.core import cfg, log
# cfg isn't used but we want the AIT-level config attribute created
from ait.core import cfg, log # noqa


def deprecated(message):
def deprecated_decorator(func):
def deprecated_func(*args, **kwargs):
log.warn("{} is a deprecated function. {}".format(func.__name__, message))
return func(*args, **kwargs)
return deprecated_func
return deprecated_decorator
def deprecated_decorator(func):
def deprecated_func(*args, **kwargs):
log.warn("{} is a deprecated function. {}".format(func.__name__, message))
return func(*args, **kwargs)

sys.modules['ait'].deprecated = deprecated
sys.modules['ait'].DEFAULT_CMD_PORT = 3075
sys.modules['ait'].DEFAULT_CMD_HOST = '127.0.0.1'
return deprecated_func

## Name of the ZMQ topic used to accept commands from external sources
sys.modules['ait'].DEFAULT_CMD_TOPIC = '__commands__'
return deprecated_decorator

## Name of the ZMQ topic / stream used for making telemetry packets available to the script API
sys.modules['ait'].DEFAULT_TLM_TOPIC = '__tlmpkts__'

## Number of seconds to sleep after ZmqSocket.connect() call, affects clients
sys.modules['ait'].DEFAULT_CMD_ZMQ_SLEEP = 1
sys.modules["ait"].deprecated = deprecated # type: ignore[attr-defined]
sys.modules["ait"].DEFAULT_CMD_PORT = 3075 # type: ignore[attr-defined]
sys.modules["ait"].DEFAULT_CMD_HOST = "127.0.0.1" # type: ignore[attr-defined]

# Name of the ZMQ topic used to accept commands from external sources
sys.modules["ait"].DEFAULT_CMD_TOPIC = "__commands__" # type: ignore[attr-defined]

# Name of the ZMQ topic / stream used for making telemetry packets available to the script API
sys.modules["ait"].DEFAULT_TLM_TOPIC = "__tlmpkts__" # type: ignore[attr-defined]

sys.modules['ait'].SERVER_DEFAULT_XSUB_URL = "tcp://*:5559"
sys.modules['ait'].SERVER_DEFAULT_XPUB_URL = "tcp://*:5560"
# Number of seconds to sleep after ZmqSocket.connect() call, affects clients
sys.modules["ait"].DEFAULT_CMD_ZMQ_SLEEP = 1 # type: ignore[attr-defined]


sys.modules["ait"].SERVER_DEFAULT_XSUB_URL = "tcp://*:5559" # type: ignore[attr-defined]
sys.modules["ait"].SERVER_DEFAULT_XPUB_URL = "tcp://*:5560" # type: ignore[attr-defined]
Loading