From ab1b2dcc6c7af8f6b3993137917d743f4556a794 Mon Sep 17 00:00:00 2001 From: Lalit Narayan Mudgal <63332774+LalitNM@users.noreply.github.com> Date: Sat, 28 Nov 2020 00:35:47 +0530 Subject: [PATCH] Create python-package.yml Update python-package.yml Removed python-3.5 and 3.6 for tests Removed 'import os' Removed 'import numpy' Shifted import at top of file Create conftest.py added requirements (after github action) added astropy to requirements --- .github/workflows/python-package.yml | 39 ++++++++++++++++++++++++++++ conftest.py | 1 + docs/conf.py | 3 ++- exohunter/__init__.py | 2 -- exohunter/preprocess.py | 1 - requirements.txt | 4 +++ 6 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/python-package.yml create mode 100644 conftest.py create mode 100644 requirements.txt diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..e1aee65 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,39 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.7', '3.8'] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..ec62639 --- /dev/null +++ b/conftest.py @@ -0,0 +1 @@ +from astropy.tests.pytest_plugins import * diff --git a/docs/conf.py b/docs/conf.py index cb9758c..f2ac9df 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,12 +9,13 @@ # -- Project information ----------------------------------------------------- +from exohunter import __version__ + project = 'exohunter' copyright = '2020, STAC IIT Mandi' author = 'STAC IIT Mandi' # The full version, including alpha/beta/rc tags -from exohunter import __version__ release = __version__ # -- General configuration --------------------------------------------------- diff --git a/exohunter/__init__.py b/exohunter/__init__.py index 17a5b20..2831f2a 100644 --- a/exohunter/__init__.py +++ b/exohunter/__init__.py @@ -1,7 +1,5 @@ # Licensed under a 3-clause BSD style license - see LICENSE.rst -import os - try: from .version import __version__ except ImportError: diff --git a/exohunter/preprocess.py b/exohunter/preprocess.py index 459d349..3fcee75 100644 --- a/exohunter/preprocess.py +++ b/exohunter/preprocess.py @@ -1,4 +1,3 @@ -import numpy as np import pandas as pd __all__ = ['reader'] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..67e0c63 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +numpy +pandas +scikit-learn +astropy