Skip to content
Snippets Groups Projects
Commit 2ceac589 authored by Hannes Feldt's avatar Hannes Feldt
Browse files

Init project

parents
Branches
Tags v0.0.2
No related merge requests found
Pipeline #109579 canceled
Pipeline: lotus

#109580

    [build-system]
    requires = [
    "setuptools>=70.0",
    "setuptools_scm[toml]>=8.0",
    "wheel"
    ]
    build-backend = "setuptools.build_meta"
    [tool.setuptools_scm]
    version_file = "lofar_lotus/_version.py"
    [tool.pylint]
    ignore = "_version.py"
    [tool.tox]
    # Generative environment list to test all supported Python versions
    requires = ["tox>=4.21"]
    env_list = ["fix", "pep8", "black", "pylint", "py{13, 12, 11, 10, 9}"]
    [tool.tox.env_run_base]
    package = "editable"
    deps = [
    "-r{toxinidir}/requirements.txt",
    "-r{toxinidir}/tests/requirements.txt"]
    set_env = { LANGUAGE = "en_US", LC_ALL = "en_US.UTF-8", PYTHONWARNINGS = "default::DeprecationWarning" }
    commands = [["python", "--version"], ["python", "-m", "pytest"]]
    [tool.tox.env.fix]
    description = "format the code base to adhere to our styles, and complain about what we cannot do automatically"
    skip_install = true
    deps = ["pre-commit-uv>=4.1.1"]
    commands = [["pre-commit", "run", "--all-files", "--show-diff-on-failure"]]
    [tool.tox.env.coverage]
    commands = [
    ["python", "--version"],
    ["python", "-m", "pytest", "--cov-report", "term", "--cov-report", "xml", "--cov-report", "html", "--cov=lofar_lotus"]]
    # Command prefixes to reuse the same virtualenv for all linting jobs.
    [tool.tox.env.pep8]
    deps = ["flake8"]
    commands = [
    ["python", "-m", "flake8", "--version"],
    ["python", "-m", "flake8", { replace = "posargs", default = ["lofar_lotus", "tests"], extend = true }]
    ]
    [tool.tox.env.black]
    deps = ["black"]
    commands = [
    ["python", "-m", "black", "--version"],
    ["python", "-m", "black", "--check", "--diff", { replace = "posargs", default = ["lofar_lotus", "tests"], extend = true }]
    ]
    [tool.tox.env.pylint]
    deps = ["pylint"]
    commands = [
    ["python", "-m", "pylint", "--version"],
    ["python", "-m", "pylint", { replace = "posargs", default = ["lofar_lotus", "tests"], extend = true }]
    ]
    [tool.tox.env.format]
    deps = ["autopep8", "black"]
    commands = [
    ["python", "-m", "autopep8", "-v", "-aa", "--in-place", "--recursive", { replace = "posargs", default = ["lofar_lotus", "tests"], extend = true }],
    ["python", "-m", "black", "-v", { replace = "posargs", default = ["lofar_lotus", "tests"], extend = true }]
    ]
    [tool.tox.env.docs]
    deps = [
    "-r{toxinidir}/requirements.txt",
    "-r{toxinidir}/docs/requirements.txt"]
    # unset LC_ALL / LANGUAGE from testenv, would fail sphinx otherwise
    set_env = ""
    changedir = "{tox_root}"
    commands = [
    ["python", "docs/cleanup.py"],
    ["sphinx-build", "-b", "html", "docs/source", "docs/build/html"]
    ]
    [tool.tox.env.build]
    package = "wheel"
    deps = ["build>=0.8.0"]
    commands = [["python", "-m", "build"]]
    [metadata]
    name = lofar_lotus
    description = An example package for CI/CD working group
    long_description = file: README.md
    long_description_content_type = text/markdown
    url = https://git.astron.nl/templates/python-package
    license = Apache License 2.0
    classifiers =
    Development Status :: 3 - Alpha
    Environment :: Web Environment
    Intended Audience :: Developers
    Intended Audience :: Science/Research
    License :: OSI Approved :: Apache Software License
    Operating System :: OS Independent
    Programming Language :: Python
    Programming Language :: Python :: 3
    Programming Language :: Python :: 3 :: Only
    Programming Language :: Python :: 3.9
    Programming Language :: Python :: 3.10
    Programming Language :: Python :: 3.11
    Programming Language :: Python :: 3.12
    Programming Language :: Python :: 3.13
    Topic :: Internet :: WWW/HTTP
    Topic :: Internet :: WWW/HTTP :: Dynamic Content
    Topic :: Scientific/Engineering
    Topic :: Scientific/Engineering :: Astronomy
    [options]
    include_package_data = true
    packages = find:
    python_requires = >=3.9
    install_requires = file: requirements.txt
    [flake8]
    max-line-length = 88
    extend-ignore = E203
    exclude=.venv,.git,.tox,dist,docs,*lib/python*,*egg,_version.py
    # Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
    # SPDX-License-Identifier: Apache-2.0
    """ Setuptools entry point """
    import setuptools
    setuptools.setup()
    setup.sh 0 → 100755
    #! /usr/bin/env bash
    #
    # Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
    # SPDX-License-Identifier: Apache-2.0
    #
    # This file's directory is used to determine the station control directory
    # location.
    if [ -z ${BASH_SOURCE} ]; then
    BASH_SOURCE=${(%):-%x}
    fi
    ABSOLUTE_PATH=$(realpath $(dirname ${BASH_SOURCE}))
    # Create a virtual environment directory if it doesn't exist
    VENV_DIR="${ABSOLUTE_PATH}/.venv"
    if [ ! -d "$VENV_DIR" ]; then
    echo "Creating virtual environment..."
    python3 -m venv "$VENV_DIR"
    fi
    # Activate the virtual environment
    source "$VENV_DIR/bin/activate"
    python -m pip install pre-commit
    python -m pip install "tox>=4.21.0"
    # Install git pre-commit pre-push hook
    if [ ! -f "${ABSOLUTE_PATH}/.git/hooks/pre-push.legacy" ]; then
    source "${ABSOLUTE_PATH}/bin/install-hooks/pre-commit.sh"
    fi
    pytest >= 7.0.0 # MIT
    pytest-cov >= 3.0.0 # MIT
    # Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
    # SPDX-License-Identifier: Apache-2.0
    """Testing of the Cool Module"""
    from unittest import TestCase
    from lofar_lotus.cool_module import greeter
    class TestCoolModule(TestCase):
    """Test Case of the Cool Module"""
    def test_greeter(self):
    """Testing that the greeter does not crash"""
    greeter()
    self.assertEqual(2 + 2, 4)
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment