Skip to main content

Static code checks used at Alphamoon

Project description

pytest-alphamoon

image image

Set of simple static code checks at Alphamoon.


This pytest plugin was generated with Cookiecutter along with @hackebrot's cookiecutter-pytest-plugin template. Source code is based on pytest-isort plugin.

Features

Package contains several plugins, as shown in Table below:

Plugin Description
import-check Checks no imports from scripts/notebooks/user_settings
init-check Checks no __init__.py file in scripts/notebooks
notebook-check Checks notebooks (.ipnyb files) are clean, without outputs
newline-check Checks files (requirements*, .gitignore or custom) for newline at the end of file
testdir-check Checks test files (files matching patterns: test_*.py or *_test.py) are under /tests directory

Requirements

pytest>=3.5.0

Installation

You can install "pytest-alphamoon" via pip from PyPI:

$ pip install pytest-alphamoon

Usage

You can add arbitrary plugin from this package by specifying its name in pytest.ini addopts section with plugin names as shown in Table above along with any other plugin you are currently using.

[pytest]
addopts = --init-check --import-check --notebook-check  --newline-check --testdir-check

import_forbidden_from =
    scripts
    user_settings
    notebooks

notebook_allowed_in =
    notebooks

init_forbidden_in =
    scripts
    notebooks

Parameters, like import_forbidden_from, shown in example configuration above are optional. If custom values are not provided in pytest.ini file, default parameters are used.

After setting up configuration file specified checks are loaded and executed automatically within test session, after invoking command:

$ pytest

Contributing

Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.

License

Distributed under the terms of the MIT license, "pytest-alphamoon" is free and open source software

Issues

If you encounter any problems, please email us at dev@alphamoon.ai, along with a detailed description.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-alphamoon-0.1.13.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

pytest_alphamoon-0.1.13-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file pytest-alphamoon-0.1.13.tar.gz.

File metadata

  • Download URL: pytest-alphamoon-0.1.13.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for pytest-alphamoon-0.1.13.tar.gz
Algorithm Hash digest
SHA256 89904d3c6d3d0196490a3bdcb88967ee4cd8d324c4ad9feadaa52fe63d7e08b2
MD5 77002233f928a3f644540a748475b122
BLAKE2b-256 d9dca3b447ae3936e3891183224fbd1603c32a89c247f57edcf22338eec0f869

See more details on using hashes here.

File details

Details for the file pytest_alphamoon-0.1.13-py3-none-any.whl.

File metadata

  • Download URL: pytest_alphamoon-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for pytest_alphamoon-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 d4d7a09e4b5ac33d103a18e4a86a9374401c10a2215b9b42d0424f8a0d07c1d4
MD5 979ca20778b8fc318d8ee3bfad6874dc
BLAKE2b-256 d9313b16ae7893e8d207628e62eaa4483892e08f3ccae4df6918589068cad62e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page