diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..dcb27ef --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,40 @@ +# 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: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10"] + + 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 \ No newline at end of file diff --git a/.github/workflows/python-pypi.yml b/.github/workflows/python-pypi.yml new file mode 100644 index 0000000..f0983ee --- /dev/null +++ b/.github/workflows/python-pypi.yml @@ -0,0 +1,41 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + push: + branches: + - publish + +jobs: + deploy: + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file diff --git a/CEDA/__init__.py b/CEDA/__init__.py index 1028de4..ceb8158 100644 --- a/CEDA/__init__.py +++ b/CEDA/__init__.py @@ -8,8 +8,4 @@ __author__ = "Terence Lau" if sys.version_info < (3, 6): print(f"CEDA {__version__} requires Python 3.6+") sys.exit(1) -del sys - -from CEDA import * -from CEDA import economic -from CEDA import market \ No newline at end of file +del sys \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 24b29b5..a71c03a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,8 @@ requests==2.25.1 six==1.16.0 urllib3==1.26.5 wincertstore==0.2 -beautifulsoup4==4-4.10.1 +beautifulsoup4 +xmltodict +tqdm +pygtrans +lxml diff --git a/setup.py b/setup.py index 0cdc3a9..a65445b 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( author = "TerenceCKLau", author_email = "terenceliu1012@outlook.com", url = "https://github.com/TerenceLiu98/CEDApy", - packages = find_packages(), + packages = (exclude=["test", "example"]), install_requires=[ "matplotlib>=3.1.1", "numpy>=1.15.4", @@ -23,7 +23,11 @@ setup( "xlrd==1.2.0", "bs4", "urllib3>=1.26.5", - "fake-useragent" + "fake-useragent", + "xmltodict", + "tqdm", + "pygtrans", + "lxml" ], license = "MIT", classifiers=[