From 3a0b7a770188b41f7ce61ee5d05a61ecc4b0e573 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Mon, 8 Mar 2021 08:33:00 -0800 Subject: [PATCH 1/5] Import code skeleton --- .github/workflows/main.yml | 27 +++++++++++++++++++++++++++ pyproject.toml | 2 ++ setup.py | 24 ++++++++++++++++++++++++ vis5/__init__.py | 6 ++++++ 4 files changed, 59 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 pyproject.toml create mode 100644 setup.py create mode 100644 vis5/__init__.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e7d75b0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,27 @@ +name: vis5-ci-build +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + + lint-code: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: + python-version: 3.9 + + - name: Install black + run: pip install black + + - name: Check code with black + run: black --check . \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2826517 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[build-system] +requires = ['setuptools', 'wheel', 'dunamai'] diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..ec31578 --- /dev/null +++ b/setup.py @@ -0,0 +1,24 @@ +from setuptools import setup, find_packages + +from vis5 import __version__ + + +# Don't install requirements if on ReadTheDocs build system. +# Load the PEP508 formatted requirements from the requirements.txt file. Needs +# pip version > 19.0 +with open("requirements.txt", "r") as fh: + requires = fh.readlines() + +setup( + name="vis5", + version=__version__, + packages=find_packages(), + python_requires=">=3.6", + install_requires=requires, + # metadata for upload to PyPI + author="Kiyo Masui, J. Richard Shaw", + author_email="richard@phas.ubc.ca", + description="vis5 data reader", + license="MIT", + url="http://github.com/radiocosmology/vis5", +) diff --git a/vis5/__init__.py b/vis5/__init__.py new file mode 100644 index 0000000..743a5a6 --- /dev/null +++ b/vis5/__init__.py @@ -0,0 +1,6 @@ +# your_library/__init__.py +import dunamai as _dunamai + +__version__ = _dunamai.get_version( + "vis5", third_choice=_dunamai.Version.from_any_vcs +) From a2864223ad8a4370211bffedd6eed5958ae4e9d9 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Mon, 8 Mar 2021 09:03:22 -0800 Subject: [PATCH 2/5] Add linters --- .github/workflows/main.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7d75b0..60691fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,8 +20,17 @@ jobs: with: python-version: 3.9 - - name: Install black - run: pip install black + - name: Install linters + run: pip install black pylint flake8 - name: Check code with black - run: black --check . \ No newline at end of file + run: black --check . + + - name: Run flake8 + run: flake8 --show-source --ignore=E501,E741,E203,W503,E266 caput + + - name: Run pylint + run: > + pylint -d + line-too-long,invalid-name,import-outside-toplevel,logging-fstring-interpolation,unnecessary-pass,no-else-return + vis5 From 95d7abd7b612ebfd80804ee7fa021e58999ac695 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Mon, 8 Mar 2021 09:47:42 -0800 Subject: [PATCH 3/5] Fix branch name --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60691fc..696adc9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,10 +2,10 @@ name: vis5-ci-build on: pull_request: branches: - - master + - main push: branches: - - master + - main jobs: From c8c9ab70e902744398c184b4903b2d7d6f2c32bb Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Mon, 8 Mar 2021 09:53:23 -0800 Subject: [PATCH 4/5] Fix linter issues --- vis5/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vis5/__init__.py b/vis5/__init__.py index 743a5a6..4fbf573 100644 --- a/vis5/__init__.py +++ b/vis5/__init__.py @@ -1,6 +1,5 @@ -# your_library/__init__.py +"""vis5 data format""" + import dunamai as _dunamai -__version__ = _dunamai.get_version( - "vis5", third_choice=_dunamai.Version.from_any_vcs -) +__version__ = _dunamai.get_version("vis5", third_choice=_dunamai.Version.from_any_vcs) From 2d0f4d7c37c3bd2e2ae54f34a803dbb6302f65b6 Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Mon, 8 Mar 2021 10:31:30 -0800 Subject: [PATCH 5/5] Fix linter --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 696adc9..c31074e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: run: black --check . - name: Run flake8 - run: flake8 --show-source --ignore=E501,E741,E203,W503,E266 caput + run: flake8 --show-source --ignore=E501,E741,E203,W503,E266 vis5 - name: Run pylint run: >