From 901bbddcd3036b3621f4e3d51610e04c703577dd Mon Sep 17 00:00:00 2001 From: Harley Vanselow Date: Thu, 25 Apr 2024 23:11:20 -0400 Subject: [PATCH 1/6] Create python-app.yml --- .github/workflows/python-app.yml | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-app.yml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..1168bd9 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,39 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.10 + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + 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 From b568353905587eab0d26848cd251d807a653098c Mon Sep 17 00:00:00 2001 From: HarleyVanselow Date: Thu, 25 Apr 2024 23:43:36 -0400 Subject: [PATCH 2/6] update test run --- .github/workflows/python-app.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 1168bd9..e1ee5c1 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -19,21 +19,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v3 with: - python-version: "3.10" + python-version: "3.11" - name: Install dependencies run: | python -m pip install --upgrade pip 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 + pip install -e - name: Test with pytest run: | - pytest + python -m pytest From 8ae828af2f5298de8a3edd9488510989d820a48c Mon Sep 17 00:00:00 2001 From: Harley Vanselow Date: Thu, 25 Apr 2024 23:46:51 -0400 Subject: [PATCH 3/6] Fix --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index e1ee5c1..b57b009 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -27,7 +27,7 @@ jobs: run: | python -m pip install --upgrade pip pip install flake8 pytest - pip install -e + pip install -e . - name: Test with pytest run: | python -m pytest From 0fcf69a7fa312bfbc446941b87f14d3c482cf64c Mon Sep 17 00:00:00 2001 From: Harley Vanselow Date: Thu, 25 Apr 2024 23:54:41 -0400 Subject: [PATCH 4/6] Create python-publish.yml --- .github/workflows/python-publish.yml | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..8d22aeb --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,39 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#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: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.11' + - 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 }} From fbeec7d07ddd2b948361bd14643f72c5b8d185c7 Mon Sep 17 00:00:00 2001 From: Harley Vanselow Date: Fri, 26 Apr 2024 00:04:30 -0400 Subject: [PATCH 5/6] Update setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3ab8f19..0a4eae4 100644 --- a/setup.py +++ b/setup.py @@ -6,8 +6,8 @@ long_description = (this_directory / "README.md").read_text() setup( - name="strnn", - version="0.2.0", + name="strnn-hv", + version="1.0.1", author="RGKLab", description="PyTorch package for Structured Neural Networks.", long_description_content_type="text/markdown", From 4ce2435e72dc9fbfc8e0274e62fd96ff4e59ac33 Mon Sep 17 00:00:00 2001 From: Harley Vanselow Date: Fri, 26 Apr 2024 00:07:23 -0400 Subject: [PATCH 6/6] Revert "Update setup.py" This reverts commit fbeec7d07ddd2b948361bd14643f72c5b8d185c7. --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 0a4eae4..3ab8f19 100644 --- a/setup.py +++ b/setup.py @@ -6,8 +6,8 @@ long_description = (this_directory / "README.md").read_text() setup( - name="strnn-hv", - version="1.0.1", + name="strnn", + version="0.2.0", author="RGKLab", description="PyTorch package for Structured Neural Networks.", long_description_content_type="text/markdown",