From b089eb3e0aab34af34cef5183c198bd3981eb5d8 Mon Sep 17 00:00:00 2001 From: checktheroads Date: Thu, 13 Feb 2020 18:27:33 -0700 Subject: [PATCH] clean up git; add actions --- .gitattributes | 16 +++++++++++----- .github/workflows/tests.yml | 35 +++++++++++++++++++++++++++++++++++ hyperglass/static/.gitignore | 16 +++++----------- pyproject.toml | 27 +++++++++++---------------- 4 files changed, 62 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.gitattributes b/.gitattributes index d2da31d..eeb6e9c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +1,16 @@ # NPM/Yarn -hyperglass/static/package.json linguist-vendored -hyperglass/static/yarn.lock linguist-vendored +hyperglass/ui/package.json linguist-vendored +hyperglass/ui/yarn.lock linguist-vendored +hyperglass/docs/package.json linguist-vendored +hyperglass/docs/yarn.lock linguist-vendored -# Templates/Examples -*.html.j2 linguist-language=HTML -*.sass.j2 linguist-language=Sass +# Static Assets +*.png linguist-vendored +*.ico linguist-vendored +browserconfig.xml linguist-generated +site.webmanifest linguist-generated + +# Example Files *.yaml.example linguist-language=YAML *.yml.example linguist-language=YAML *.md.example linguist-language=Markdown diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..8b546fa --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,35 @@ +name: Run Tests +on: + pull_request: + branches: + - v1.0.0 + +jobs: + build: + runs-on: ubuntu-18.04 + steps: + - name: Setup Python 3.6.8 + uses: actions/setup-python@v1 + with: + python-version: 3.6.8 + - name: Install System Dependencies + run: | + apt install -y redis-server + - name: Install Python Dependencies + run: | + pip install . + - name: lint + uses: ricardochaves/python-lint@v1.1.0 + with: + use-black: true + use-flake8: true + use-isort: true + use-pylint: false + use-pycodestyle: false + use-mypy: false + extra-pylint-options: "" + extra-pycodestyle-options: "" + extra-flake8-options: "" + extra-black-options: "" + extra-mypy-options: "" + extra-isort-options: "" diff --git a/hyperglass/static/.gitignore b/hyperglass/static/.gitignore index 28d76cd..40766c6 100644 --- a/hyperglass/static/.gitignore +++ b/hyperglass/static/.gitignore @@ -1,15 +1,9 @@ .DS_Store +src +ui/* +!ui/.gitkeep + # dev/test files *.tmp* test* -*.log -# generated theme file from hyperglass/hyperglass/render/templates/theme.sass.j2 -theme.sass -# generated JSON file from ingested & validated YAML config -frontend.json -# NPM modules -node_modules/ -# Downloaded Google Fonts -fonts/ -ui/* -!ui/.gitkeep \ No newline at end of file +*.log \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5f8e178..492a400 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,11 +6,15 @@ build-backend = "poetry.masonry.api" name = "hyperglass" version = "1.0.0" description = "hyperglass is a modern, customizable network looking glass written in Python 3." -authors = ["checktheroads "] +authors = ["Matt Love "] license = "BSD-3-Clause-Clear" +[tool.poetry.scripts] +hyperglass = "hyperglass.console" + [tool.poetry.dependencies] aiofile = "^1.5.2" +aiofiles = "^0.4.0" aredis = "^1.1.7" click = "^7.0" cryptography = "^2.8" @@ -26,19 +30,17 @@ PyJWT = "^1.7.1" python = "^3.7" PyYAML = "^5.2" redis = "^3.3.11" +rich = "^0.3.3" sshtunnel = "^0.1.5" stackprinter = "^0.2.3" ujson = "^1.35" uvicorn = "^0.11.1" uvloop = "^0.14.0" -aiofiles = "^0.4.0" -rich = "^0.3.3" [tool.poetry.dev-dependencies] anybadge = "^1.6.2" -black = "^19.10b0" -isort = "^4.3.21" bandit = "^1.6.2" +black = "^19.10b0" flake8 = "^3.7.9" flake8-bandit = "^2.1.2" flake8-black = "^0.1.1" @@ -47,6 +49,7 @@ flake8-bugbear = "^20.1.0" flake8-builtins = "^1.4.2" flake8-comprehensions = "^3.1.4" flake8-deprecated = "^1.3" +flake8-docstrings = "^1.5.0" flake8-eradicate = "^0.2.4" flake8-if-expr = "^1.0.0" flake8-isort = "^2.8.0" @@ -55,18 +58,10 @@ flake8-plugin-utils = "^1.0.0" flake8-polyfill = "^1.0.2" flake8-print = "^3.1.4" flake8-return = "^1.1.1" -pep8-naming = "^0.9.1" -flake8-docstrings = "^1.5.0" -pre-commit = "^1.21.0" +isort = "^4.3.21" mccabe = "^0.6.1" - -[tool.isort] -line_length = 88 -indent = ' ' -force_single_line = true -import_heading_stdlib = "Standard Library Imports" -import_heading_thirdparty = "Third Party Imports" -import_heading_firstparty = "Project Imports" +pep8-naming = "^0.9.1" +pre-commit = "^1.21.0" [tool.black] line-length = 88