diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..b21bed1 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,48 @@ +name: lint + +on: + push: + pull_request: + types: [ opened, reopened, synchronize ] + +jobs: + check: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [ '3.8', '3.x' ] + + name: check ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up CPython ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + id: install-deps + run: | + python -m pip install --upgrade pip setuptools wheel black==22.6 requests + pip install -U -r requirements.txt + + - name: Setup node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Run Pyright + uses: jakebailey/pyright-action@v1 + with: + version: '1.1.289' + warnings: false + no-comments: ${{ matrix.python-version != '3.x' }} + + - name: Run black + if: ${{ always() && steps.install-deps.outcome == 'success' }} + run: | + black --check rustplus \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9efbcfa..40b83c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,7 @@ name: Upload Python Package on: + workflow_dispatch: release: types: [created] diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml deleted file mode 100644 index 95177bf..0000000 --- a/.github/workflows/workflow.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Upload Python Package - -on: - - workflow_dispatch - -jobs: - deploy: - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0a43250 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +websocket_client +Pillow +protobuf==4.21.6 +asyncio +rustPlusPushReceiver==0.4.1 +http-ece +requests +numpy +scipy \ No newline at end of file diff --git a/setup.py b/setup.py index 8065cb9..6b3ac32 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,11 @@ version = line.strip("__version__ =").strip().strip('"') break +requirements = [] +with open("requirements.txt") as input_file: + for line in input_file.readlines(): + requirements.append(line.strip()) + with open("README.md", errors='ignore') as input_file: readme = input_file.read() @@ -24,26 +29,6 @@ long_description=readme, include_package_data=True, long_description_content_type='text/markdown', - install_requires=[ - "websocket_client", - "Pillow", - "protobuf==4.21.6", - "asyncio", - "rustPlusPushReceiver==0.4.1", - "http-ece", - "requests", - "numpy", - "scipy", - ], - extras_require={ - 'test': [ - 'coverage[toml]', - 'pytest', - 'pytest-asyncio', - 'pytest-cov', - 'pytest-mock', - 'typing-extensions>=4.3,<5', - ], - }, + install_requires=requirements, python_requires='>=3.8.0', )