From 343583d56e3f3f613fa21472f733a6652c0230d1 Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Mon, 17 Apr 2023 15:45:26 -0400 Subject: [PATCH 01/19] feat: Update project to use poetry for build and wheel packaging --- .github/workflows/publish.yaml | 42 +++++++++++++++++++++++++++++++++ .github/workflows/tests.yaml | 1 + .gitignore | 1 + build.py | 25 ++++++++++++++++++++ pyproject.toml | 24 +++++++++++++++++++ python/pythonmonkey/__init__.py | 1 + 6 files changed, 94 insertions(+) create mode 100644 .github/workflows/publish.yaml create mode 100644 build.py create mode 100644 pyproject.toml create mode 100644 python/pythonmonkey/__init__.py diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..cc98aac2 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,42 @@ +name: 'Build and publish package' + +on: + push: + tags: + - '*' + +jobs: + tests: + uses: ./.github/workflows/tests.yaml + deploy: + needs: [tests] + strategy: + matrix: + os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] + python_version: [ '3.10' ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + - name: Install Poetry + uses: snok/install-poetry@v1 + - name: Setup cmake + run: | + sudo apt-get install -y cmake doxygen graphviz gcovr llvm python3-dev python3-pytest + pip install pytest + - name: Cache spidermonkey build + id: cache-spidermonkey + uses: actions/cache@v3 + with: + path: | + ./build/* + ./firefox-102.2.0/* + ./_spidermonkey_install/* + key: ${{ runner.os }}-spidermonkey + - name: Build-Library + if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} + run: ./setup.sh + - name: Buid and Publish package + run: poetry publish --build --username __token__ --password $PYPI_API_TOKEN diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 01ef0077..d564c1de 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -4,6 +4,7 @@ on: push: branches: - main + workflow_call: workflow_dispatch: pull_request: diff --git a/.gitignore b/.gitignore index a66f88ed..6eca77a6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ tests/__pycache__/* tests/python/__pycache__/* Testing/Temporary _spidermonkey_install +__pycache__ diff --git a/build.py b/build.py new file mode 100644 index 00000000..a47c1fda --- /dev/null +++ b/build.py @@ -0,0 +1,25 @@ +import subprocess +import os, sys + +dir_path = os.path.dirname( os.path.realpath(__file__) ) + + +def execute(cmd: str): + popen = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, + shell = True, text = True ) + for stdout_line in iter(popen.stdout.readline, ""): + sys.stdout.write(stdout_line) + sys.stdout.flush() + + popen.stdout.close() + return_code = popen.wait() + if return_code: + raise subprocess.CalledProcessError(return_code, cmd) + +def build(): + build_script_sh = os.path.join( dir_path, 'build_script.sh' ) + execute(f"bash {build_script_sh}") + execute(f"cp ./build/src/pythonmonkey.so ./python/pythonmonkey/_pythonmonkey.so") + +if __name__ == "__main__": + build() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..1a21061f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,24 @@ +[tool.poetry] +name = "pythonmonkey" +version = "0.1.0" +description = "" +authors = ["Caleb Aikens ", "Tom Tang "] +readme = "README.md" +packages = [ + { include = "pythonmonkey", from = "python" }, +] + + +[tool.poetry.dependencies] +python = "^3.9" + + +[tool.poetry.build] +script = "build.py" +generate-setup-file = false + + +[build-system] +requires = ["poetry-core>=1.0.0a9"] +build-backend = "poetry.core.masonry.api" + diff --git a/python/pythonmonkey/__init__.py b/python/pythonmonkey/__init__.py new file mode 100644 index 00000000..f643b61f --- /dev/null +++ b/python/pythonmonkey/__init__.py @@ -0,0 +1 @@ +from .pythonmonkey import * From 9e5c9d4abd10b61e84db3421082aba58088768a2 Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Fri, 21 Apr 2023 15:44:16 -0400 Subject: [PATCH 02/19] ci: Updated tests yaml to run pytests on a gamut of python versions --- .github/workflows/tests.yaml | 36 +++++++++++++++++++++++++++++++++--- build.py | 2 +- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d564c1de..1edb0fcf 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] - python_version: [ '3.10' ] + python_version: [ '3.9' ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -36,16 +36,46 @@ jobs: - name: Build-Library if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} run: ./setup.sh && ./build_script.sh + - name: Setup Poetry + uses: snok/install-poetry@v1 + - name: Build wheel + run: poetry build --format=wheel - name: google-tests run: | cd build make && make tests gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml cd tests && ctest - cd ../src - python -m pytest ../../tests/python + cd ../../ + python -m pip install ./dist/*.whl + python -m pytest tests/python + - name: Upload wheel artifacts + uses: actions/upload-artifact@v3 + with: + name: pythonmonkey-wheel-${{ github.sha }} + path: dist/*.whl - name: google-tests-artifacts uses: actions/upload-artifact@v3 with: name: ${{ github.job }}-${{ github.run_id }}-${{ github.sha }} path: ./build/coverage.xml + test-wheels: + needs: test-suite + strategy: + matrix: + os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] + python_version: [ '3.9', '3.10', '3.11' ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python_version }} + - name: Download wheel artifacts + uses: actions/download-artifact@v3 + with: + name: pythonmonkey-wheel-${{ github.sha }} + - name: Install pythonmonkey wheel + run: python -m pip install ./dist/*.whl + - name: Run pytests + run: python -m pytest tests/python diff --git a/build.py b/build.py index a47c1fda..4137c858 100644 --- a/build.py +++ b/build.py @@ -19,7 +19,7 @@ def execute(cmd: str): def build(): build_script_sh = os.path.join( dir_path, 'build_script.sh' ) execute(f"bash {build_script_sh}") - execute(f"cp ./build/src/pythonmonkey.so ./python/pythonmonkey/_pythonmonkey.so") + execute(f"cp ./build/src/pythonmonkey.so ./python/pythonmonkey/pythonmonkey.so") if __name__ == "__main__": build() From 0b047a54ef0edf1f629594b886f596278fa99b82 Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Fri, 21 Apr 2023 15:50:58 -0400 Subject: [PATCH 03/19] CI: Download and install pythonwheel artifact --- .github/workflows/tests.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 1edb0fcf..ca1fb484 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,7 +16,7 @@ jobs: python_version: [ '3.9' ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} @@ -67,7 +67,7 @@ jobs: python_version: [ '3.9', '3.10', '3.11' ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} @@ -76,6 +76,6 @@ jobs: with: name: pythonmonkey-wheel-${{ github.sha }} - name: Install pythonmonkey wheel - run: python -m pip install ./dist/*.whl + run: echo ls -lah ./* && python -m pip install ./*.whl - name: Run pytests run: python -m pytest tests/python From 7540eb3ab639f421e4860bc663b048038cb68880 Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Fri, 21 Apr 2023 15:57:57 -0400 Subject: [PATCH 04/19] CI: Update tests to install wheel and poetry dependencies --- .github/workflows/tests.yaml | 8 +++++--- pyproject.toml | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ca1fb484..c7f1c484 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -71,11 +71,13 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} + - name: Setup poetry + uses: snok/install-poetry@v1 - name: Download wheel artifacts uses: actions/download-artifact@v3 with: name: pythonmonkey-wheel-${{ github.sha }} - - name: Install pythonmonkey wheel - run: echo ls -lah ./* && python -m pip install ./*.whl + - name: Install pythonmonkey wheel and poetry dependencies + run: python -m pip install ./*.whl && poetry install --no-root - name: Run pytests - run: python -m pytest tests/python + run: poetry run pytest tests/python diff --git a/pyproject.toml b/pyproject.toml index 1a21061f..83ad29b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,9 @@ script = "build.py" generate-setup-file = false +[tool.poetry.group.dev.dependencies] +pytest = "^7.3.1" + [build-system] requires = ["poetry-core>=1.0.0a9"] build-backend = "poetry.core.masonry.api" From 9b9683a2702a461603ac09fa775175cf6d7b1725 Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Fri, 21 Apr 2023 16:09:07 -0400 Subject: [PATCH 05/19] CI: Run dist wheel build for each version of python and test as well --- .github/workflows/tests.yaml | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c7f1c484..91f0edab 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] - python_version: [ '3.9' ] + python_version: [ '3.9', '3.10', '3.11' ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -49,35 +49,9 @@ jobs: cd ../../ python -m pip install ./dist/*.whl python -m pytest tests/python - - name: Upload wheel artifacts - uses: actions/upload-artifact@v3 - with: - name: pythonmonkey-wheel-${{ github.sha }} - path: dist/*.whl - name: google-tests-artifacts uses: actions/upload-artifact@v3 with: name: ${{ github.job }}-${{ github.run_id }}-${{ github.sha }} path: ./build/coverage.xml - test-wheels: - needs: test-suite - strategy: - matrix: - os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] - python_version: [ '3.9', '3.10', '3.11' ] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python_version }} - - name: Setup poetry - uses: snok/install-poetry@v1 - - name: Download wheel artifacts - uses: actions/download-artifact@v3 - with: - name: pythonmonkey-wheel-${{ github.sha }} - - name: Install pythonmonkey wheel and poetry dependencies - run: python -m pip install ./*.whl && poetry install --no-root - - name: Run pytests - run: poetry run pytest tests/python + From 53ebc676ef5f9b9408854c533e0b41992d273755 Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Fri, 21 Apr 2023 16:11:00 -0400 Subject: [PATCH 06/19] CI: Disable interactive publish --- .github/workflows/publish.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index cc98aac2..7fb12f9e 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] - python_version: [ '3.10' ] + python_version: [ '3.9', '3.10', '3.11' ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -39,4 +39,4 @@ jobs: if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} run: ./setup.sh - name: Buid and Publish package - run: poetry publish --build --username __token__ --password $PYPI_API_TOKEN + run: poetry publish --no-interaction --build --username __token__ --password $PYPI_API_TOKEN From 03756670da326e4e63cd24028d67eb396956475f Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Wed, 24 May 2023 12:43:36 -0400 Subject: [PATCH 07/19] test: Attempting to update CI --- .github/workflows/publish.yaml | 5 +- .github/workflows/tests.yaml | 49 ++++++++------- .gitignore | 2 + poetry.lock | 108 +++++++++++++++++++++++++++++++++ setup.sh | 2 +- 5 files changed, 143 insertions(+), 23 deletions(-) create mode 100644 poetry.lock diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 7fb12f9e..be66d85f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -39,4 +39,7 @@ jobs: if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} run: ./setup.sh - name: Buid and Publish package - run: poetry publish --no-interaction --build --username __token__ --password $PYPI_API_TOKEN + run: | + poetry build + ls -lah ./dist/ + #poetry publish --no-interaction --build --username __token__ --password $PYPI_API_TOKEN diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 91f0edab..89563b7f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -2,8 +2,8 @@ name: 'Testing Suite' on: push: - branches: - - main + # branches: + # - main workflow_call: workflow_dispatch: pull_request: @@ -13,17 +13,18 @@ jobs: strategy: matrix: os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] - python_version: [ '3.9', '3.10', '3.11' ] + python_version: [ '3.9' ] #'3.10', '3.11' ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python_version }} + python-version: ${{ matrix.python_version }}-dev - name: Setup cmake run: | - sudo apt-get install -y cmake doxygen graphviz gcovr llvm python3-dev python3-pytest - pip install pytest + sudo apt-get update -y + sudo apt-get install -y cmake doxygen graphviz gcovr llvm + python3 --version - name: Cache spidermonkey build id: cache-spidermonkey uses: actions/cache@v3 @@ -35,23 +36,29 @@ jobs: key: ${{ runner.os }}-spidermonkey - name: Build-Library if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} - run: ./setup.sh && ./build_script.sh + run: ./setup.sh #&& ./build_script.sh - name: Setup Poetry uses: snok/install-poetry@v1 - name: Build wheel - run: poetry build --format=wheel - - name: google-tests run: | - cd build - make && make tests - gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml - cd tests && ctest - cd ../../ - python -m pip install ./dist/*.whl - python -m pytest tests/python - - name: google-tests-artifacts - uses: actions/upload-artifact@v3 - with: - name: ${{ github.job }}-${{ github.run_id }}-${{ github.sha }} - path: ./build/coverage.xml + poetry env use system + echo $(poetry run python --version) && sleep 15 + poetry run python -m pip install --upgrade pip + poetry build --format=wheel + ls -lah ./dist/ + #- name: google-tests + # run: | + # cd build + # make && make tests + # gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml + # cd tests && ctest + # cd ../../ + # poetry run -m pip install ./dist/*.whl + # poetry install --no-root + # python -m pytest tests/python + #- name: google-tests-artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: ${{ github.job }}-${{ github.run_id }}-${{ github.sha }} + # path: ./build/coverage.xml diff --git a/.gitignore b/.gitignore index 6eca77a6..f48e7479 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,5 @@ tests/python/__pycache__/* Testing/Temporary _spidermonkey_install __pycache__ +dist +*.so diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..b4ecf22c --- /dev/null +++ b/poetry.lock @@ -0,0 +1,108 @@ +# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand. + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +category = "dev" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.1.1" +description = "Backport of PEP 654 (exception groups)" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.1.1-py3-none-any.whl", hash = "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e"}, + {file = "exceptiongroup-1.1.1.tar.gz", hash = "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "packaging" +version = "23.1" +description = "Core utilities for Python packages" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, + {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, +] + +[[package]] +name = "pluggy" +version = "1.0.0" +description = "plugin and hook calling mechanisms for python" +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ + {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, + {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pytest" +version = "7.3.1" +description = "pytest: simple powerful testing with Python" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pytest-7.3.1-py3-none-any.whl", hash = "sha256:3799fa815351fea3a5e96ac7e503a96fa51cc9942c3753cda7651b93c1cfa362"}, + {file = "pytest-7.3.1.tar.gz", hash = "sha256:434afafd78b1d78ed0addf160ad2b77a30d35d4bdf8af234fe621919d9ed15e3"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} + +[package.extras] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "^3.9" +content-hash = "9088c98fe73ffd29e9cbd25423ee2e6fafd09da9e86ed11213fcad8cf1ab0597" diff --git a/setup.sh b/setup.sh index b1f75598..a0f45b80 100755 --- a/setup.sh +++ b/setup.sh @@ -9,7 +9,7 @@ CPUS=$(getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/ echo "Installing dependencies" sudo apt-get update --yes sudo apt-get upgrade --yes -sudo apt-get install cmake python3-dev python3-pytest doxygen graphviz gcovr llvm g++ pkg-config m4 --yes +sudo apt-get install cmake doxygen graphviz gcovr llvm g++ pkg-config m4 --yes sudo curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y #install rust compiler echo "Done installing dependencies" From 069c87c112793bc6a86d1d7b04830026b5d685cc Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Wed, 24 May 2023 13:12:08 -0400 Subject: [PATCH 08/19] test: Attempting to update CI --- .github/workflows/publish.yaml | 6 ++++-- .github/workflows/tests.yaml | 13 ++++++++----- poetry.lock | 14 +++++++++++++- pyproject.toml | 1 + 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index be66d85f..151ac7de 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -20,12 +20,14 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} + cache: "poetry" + update-environment: true - name: Install Poetry uses: snok/install-poetry@v1 - name: Setup cmake run: | - sudo apt-get install -y cmake doxygen graphviz gcovr llvm python3-dev python3-pytest - pip install pytest + sudo apt-get install -y cmake doxygen graphviz gcovr llvm + poetry install --no-root - name: Cache spidermonkey build id: cache-spidermonkey uses: actions/cache@v3 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 89563b7f..64561cb4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,11 +19,18 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python_version }}-dev + python-version: ${{ matrix.python_version }} + cache: "poetry" + - name: Setup Poetry + uses: snok/install-poetry@v1 - name: Setup cmake run: | + echo "Installing Dependencies" sudo apt-get update -y sudo apt-get install -y cmake doxygen graphviz gcovr llvm + echo "Installing python deps" + poetry install --no-root + echo "Installed Dependencies" python3 --version - name: Cache spidermonkey build id: cache-spidermonkey @@ -37,13 +44,9 @@ jobs: - name: Build-Library if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} run: ./setup.sh #&& ./build_script.sh - - name: Setup Poetry - uses: snok/install-poetry@v1 - name: Build wheel run: | - poetry env use system echo $(poetry run python --version) && sleep 15 - poetry run python -m pip install --upgrade pip poetry build --format=wheel ls -lah ./dist/ #- name: google-tests diff --git a/poetry.lock b/poetry.lock index b4ecf22c..658acead 100644 --- a/poetry.lock +++ b/poetry.lock @@ -51,6 +51,18 @@ files = [ {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, ] +[[package]] +name = "pip" +version = "23.1.2" +description = "The PyPA recommended tool for installing Python packages." +category = "dev" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pip-23.1.2-py3-none-any.whl", hash = "sha256:3ef6ac33239e4027d9a5598a381b9d30880a1477e50039db2eac6e8a8f6d1b18"}, + {file = "pip-23.1.2.tar.gz", hash = "sha256:0e7c86f486935893c708287b30bd050a36ac827ec7fe5e43fe7cb198dd835fba"}, +] + [[package]] name = "pluggy" version = "1.0.0" @@ -105,4 +117,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "9088c98fe73ffd29e9cbd25423ee2e6fafd09da9e86ed11213fcad8cf1ab0597" +content-hash = "8f7283321d490f4870d8a9cd5008acfc0f1a2b231dc55e44155e67b2cffb9687" diff --git a/pyproject.toml b/pyproject.toml index 83ad29b1..16e1e074 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,7 @@ generate-setup-file = false [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" +pip = "^23.1.2" [build-system] requires = ["poetry-core>=1.0.0a9"] From 0c64eec6a5df2b4bfc33f210827a800981fc2a93 Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Wed, 24 May 2023 13:16:15 -0400 Subject: [PATCH 09/19] fix: Update setup python in tests workflow --- .github/workflows/tests.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 64561cb4..b9e7990c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -20,7 +20,6 @@ jobs: - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - cache: "poetry" - name: Setup Poetry uses: snok/install-poetry@v1 - name: Setup cmake From ca7aa7fbab44841a8cef3be8ebb283b6c0a89565 Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Wed, 24 May 2023 13:21:10 -0400 Subject: [PATCH 10/19] ci: Update tests workflow back to run gcovr and python tests --- .github/workflows/tests.yaml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b9e7990c..f73bcb14 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -30,7 +30,6 @@ jobs: echo "Installing python deps" poetry install --no-root echo "Installed Dependencies" - python3 --version - name: Cache spidermonkey build id: cache-spidermonkey uses: actions/cache@v3 @@ -45,22 +44,21 @@ jobs: run: ./setup.sh #&& ./build_script.sh - name: Build wheel run: | - echo $(poetry run python --version) && sleep 15 + echo $(poetry run python --version) poetry build --format=wheel ls -lah ./dist/ - #- name: google-tests - # run: | - # cd build - # make && make tests - # gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml - # cd tests && ctest - # cd ../../ - # poetry run -m pip install ./dist/*.whl - # poetry install --no-root - # python -m pytest tests/python - #- name: google-tests-artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: ${{ github.job }}-${{ github.run_id }}-${{ github.sha }} - # path: ./build/coverage.xml + - name: google-tests + run: | + cd build + make && make tests + gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml + cd tests && ctest + cd ../../ + poetry run python -m pip install ./dist/*.whl + poetry run python -m pytest tests/python + - name: google-tests-artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ github.job }}-${{ github.run_id }}-${{ github.sha }} + path: ./build/coverage.xml From e77f5fcf485b5e965a186792685331f4caabbe6a Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Wed, 24 May 2023 13:46:25 -0400 Subject: [PATCH 11/19] fix: Fix pyproject to properly include pythonmonkey.so --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 16e1e074..61233158 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,7 @@ readme = "README.md" packages = [ { include = "pythonmonkey", from = "python" }, ] +include = [ "python/pythonmonkey/pythonmonkey.so" ] [tool.poetry.dependencies] From 8291aa94ef50b1575c359210691fb1ad33b7a0be Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Wed, 24 May 2023 13:50:28 -0400 Subject: [PATCH 12/19] ci: Update matrix to include 3.10 and 3.11 --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f73bcb14..8d0cd2e1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] - python_version: [ '3.9' ] #'3.10', '3.11' ] + python_version: [ '3.9', '3.10', '3.11' ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 From 02f2fbfe18d50f2dba005a7f9b04d665d0be563b Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Wed, 24 May 2023 13:56:57 -0400 Subject: [PATCH 13/19] fix: 3.11 is broken, removed from matrix --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8d0cd2e1..64284f43 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] - python_version: [ '3.9', '3.10', '3.11' ] + python_version: [ '3.9', '3.10' ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 From ead2fd62503ec074895c27fe79747ec558a70f6d Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Wed, 24 May 2023 14:03:49 -0400 Subject: [PATCH 14/19] fix: Update publish to match test build process --- .github/workflows/publish.yaml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 151ac7de..06933aed 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -13,21 +13,23 @@ jobs: strategy: matrix: os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] - python_version: [ '3.9', '3.10', '3.11' ] + python_version: [ '3.9', '3.10' ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python_version }} - cache: "poetry" - update-environment: true - - name: Install Poetry + - name: Setup Poetry uses: snok/install-poetry@v1 - name: Setup cmake run: | + echo "Installing Dependencies" + sudo apt-get update -y sudo apt-get install -y cmake doxygen graphviz gcovr llvm + echo "Installing python deps" poetry install --no-root + echo "Installed Dependencies" - name: Cache spidermonkey build id: cache-spidermonkey uses: actions/cache@v3 @@ -39,9 +41,8 @@ jobs: key: ${{ runner.os }}-spidermonkey - name: Build-Library if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} - run: ./setup.sh + run: ./setup.sh #&& ./build_script.sh - name: Buid and Publish package - run: | - poetry build - ls -lah ./dist/ - #poetry publish --no-interaction --build --username __token__ --password $PYPI_API_TOKEN + run: | + echo $(poetry run python --version) + poetry publish --no-interaction --build --username __token__ --password $PYPI_API_TOKEN From 391fe619ddc3f541dd2d8be3279bb36592de09db Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Wed, 24 May 2023 14:11:30 -0400 Subject: [PATCH 15/19] ci: Make sure publish doesn't die if existing published version is already published --- .github/workflows/publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 06933aed..845b67a9 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -45,4 +45,4 @@ jobs: - name: Buid and Publish package run: | echo $(poetry run python --version) - poetry publish --no-interaction --build --username __token__ --password $PYPI_API_TOKEN + poetry publish --no-interaction --skip-existing --build --username __token__ --password $PYPI_API_TOKEN From 390479ec918d57238afde72a5cbcf3beaecda78a Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Mon, 29 May 2023 09:30:44 -0400 Subject: [PATCH 16/19] ci: Merge test and publish yamls and only run publish on success and tag --- .github/workflows/publish.yaml | 48 ------------------- .../{tests.yaml => test-and-publish.yaml} | 12 +++-- poetry.lock | 40 +++++++++++++++- pyproject.toml | 1 + 4 files changed, 47 insertions(+), 54 deletions(-) delete mode 100644 .github/workflows/publish.yaml rename .github/workflows/{tests.yaml => test-and-publish.yaml} (83%) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index 845b67a9..00000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: 'Build and publish package' - -on: - push: - tags: - - '*' - -jobs: - tests: - uses: ./.github/workflows/tests.yaml - deploy: - needs: [tests] - strategy: - matrix: - os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] - python_version: [ '3.9', '3.10' ] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python_version }} - - name: Setup Poetry - uses: snok/install-poetry@v1 - - name: Setup cmake - run: | - echo "Installing Dependencies" - sudo apt-get update -y - sudo apt-get install -y cmake doxygen graphviz gcovr llvm - echo "Installing python deps" - poetry install --no-root - echo "Installed Dependencies" - - name: Cache spidermonkey build - id: cache-spidermonkey - uses: actions/cache@v3 - with: - path: | - ./build/* - ./firefox-102.2.0/* - ./_spidermonkey_install/* - key: ${{ runner.os }}-spidermonkey - - name: Build-Library - if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }} - run: ./setup.sh #&& ./build_script.sh - - name: Buid and Publish package - run: | - echo $(poetry run python --version) - poetry publish --no-interaction --skip-existing --build --username __token__ --password $PYPI_API_TOKEN diff --git a/.github/workflows/tests.yaml b/.github/workflows/test-and-publish.yaml similarity index 83% rename from .github/workflows/tests.yaml rename to .github/workflows/test-and-publish.yaml index 8d0cd2e1..0ac2129f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -1,15 +1,13 @@ -name: 'Testing Suite' +name: 'Test and Publish Suite' on: push: - # branches: - # - main workflow_call: workflow_dispatch: pull_request: jobs: - test-suite: + test-and-publish: strategy: matrix: os: [ 'ubuntu-latest' ] # , 'windows-latest', 'macos-latest' ] @@ -61,4 +59,8 @@ jobs: with: name: ${{ github.job }}-${{ github.run_id }}-${{ github.sha }} path: ./build/coverage.xml - + - name: Buid and Publish package + if: ${{ success() }} && github.event_name == 'push' && contains(github.ref, 'refs/tags/') + run: | + echo $(poetry run python --version) + poetry publish --no-interaction --skip-existing --build --username __token__ --password $PYPI_API_TOKEN diff --git a/poetry.lock b/poetry.lock index 658acead..e7436edf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -39,6 +39,44 @@ files = [ {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, ] +[[package]] +name = "numpy" +version = "1.24.3" +description = "Fundamental package for array computing in Python" +category = "dev" +optional = false +python-versions = ">=3.8" +files = [ + {file = "numpy-1.24.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3c1104d3c036fb81ab923f507536daedc718d0ad5a8707c6061cdfd6d184e570"}, + {file = "numpy-1.24.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:202de8f38fc4a45a3eea4b63e2f376e5f2dc64ef0fa692838e31a808520efaf7"}, + {file = "numpy-1.24.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8535303847b89aa6b0f00aa1dc62867b5a32923e4d1681a35b5eef2d9591a463"}, + {file = "numpy-1.24.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2d926b52ba1367f9acb76b0df6ed21f0b16a1ad87c6720a1121674e5cf63e2b6"}, + {file = "numpy-1.24.3-cp310-cp310-win32.whl", hash = "sha256:f21c442fdd2805e91799fbe044a7b999b8571bb0ab0f7850d0cb9641a687092b"}, + {file = "numpy-1.24.3-cp310-cp310-win_amd64.whl", hash = "sha256:ab5f23af8c16022663a652d3b25dcdc272ac3f83c3af4c02eb8b824e6b3ab9d7"}, + {file = "numpy-1.24.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9a7721ec204d3a237225db3e194c25268faf92e19338a35f3a224469cb6039a3"}, + {file = "numpy-1.24.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d6cc757de514c00b24ae8cf5c876af2a7c3df189028d68c0cb4eaa9cd5afc2bf"}, + {file = "numpy-1.24.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76e3f4e85fc5d4fd311f6e9b794d0c00e7002ec122be271f2019d63376f1d385"}, + {file = "numpy-1.24.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a1d3c026f57ceaad42f8231305d4653d5f05dc6332a730ae5c0bea3513de0950"}, + {file = "numpy-1.24.3-cp311-cp311-win32.whl", hash = "sha256:c91c4afd8abc3908e00a44b2672718905b8611503f7ff87390cc0ac3423fb096"}, + {file = "numpy-1.24.3-cp311-cp311-win_amd64.whl", hash = "sha256:5342cf6aad47943286afa6f1609cad9b4266a05e7f2ec408e2cf7aea7ff69d80"}, + {file = "numpy-1.24.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7776ea65423ca6a15255ba1872d82d207bd1e09f6d0894ee4a64678dd2204078"}, + {file = "numpy-1.24.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ae8d0be48d1b6ed82588934aaaa179875e7dc4f3d84da18d7eae6eb3f06c242c"}, + {file = "numpy-1.24.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ecde0f8adef7dfdec993fd54b0f78183051b6580f606111a6d789cd14c61ea0c"}, + {file = "numpy-1.24.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4749e053a29364d3452c034827102ee100986903263e89884922ef01a0a6fd2f"}, + {file = "numpy-1.24.3-cp38-cp38-win32.whl", hash = "sha256:d933fabd8f6a319e8530d0de4fcc2e6a61917e0b0c271fded460032db42a0fe4"}, + {file = "numpy-1.24.3-cp38-cp38-win_amd64.whl", hash = "sha256:56e48aec79ae238f6e4395886b5eaed058abb7231fb3361ddd7bfdf4eed54289"}, + {file = "numpy-1.24.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4719d5aefb5189f50887773699eaf94e7d1e02bf36c1a9d353d9f46703758ca4"}, + {file = "numpy-1.24.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0ec87a7084caa559c36e0a2309e4ecb1baa03b687201d0a847c8b0ed476a7187"}, + {file = "numpy-1.24.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea8282b9bcfe2b5e7d491d0bf7f3e2da29700cec05b49e64d6246923329f2b02"}, + {file = "numpy-1.24.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:210461d87fb02a84ef243cac5e814aad2b7f4be953b32cb53327bb49fd77fbb4"}, + {file = "numpy-1.24.3-cp39-cp39-win32.whl", hash = "sha256:784c6da1a07818491b0ffd63c6bbe5a33deaa0e25a20e1b3ea20cf0e43f8046c"}, + {file = "numpy-1.24.3-cp39-cp39-win_amd64.whl", hash = "sha256:d5036197ecae68d7f491fcdb4df90082b0d4960ca6599ba2659957aafced7c17"}, + {file = "numpy-1.24.3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:352ee00c7f8387b44d19f4cada524586f07379c0d49270f87233983bc5087ca0"}, + {file = "numpy-1.24.3-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1a7d6acc2e7524c9955e5c903160aa4ea083736fde7e91276b0e5d98e6332812"}, + {file = "numpy-1.24.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:35400e6a8d102fd07c71ed7dcadd9eb62ee9a6e84ec159bd48c28235bbb0f8e4"}, + {file = "numpy-1.24.3.tar.gz", hash = "sha256:ab344f1bf21f140adab8e47fdbc7c35a477dc01408791f8ba00d018dd0bc5155"}, +] + [[package]] name = "packaging" version = "23.1" @@ -117,4 +155,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "8f7283321d490f4870d8a9cd5008acfc0f1a2b231dc55e44155e67b2cffb9687" +content-hash = "0c9a2b046f659d7744e72ff22e19b4ed431c92c61ac00b59a0acd8c48d0a85f6" diff --git a/pyproject.toml b/pyproject.toml index 61233158..46b47cc0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ generate-setup-file = false [tool.poetry.group.dev.dependencies] pytest = "^7.3.1" pip = "^23.1.2" +numpy = "^1.24.3" [build-system] requires = ["poetry-core>=1.0.0a9"] From 8ca6c4969eb4eb564d4b5842f97da523019b21f2 Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Mon, 29 May 2023 10:02:34 -0400 Subject: [PATCH 17/19] CI: Fix if statement for running poetry publish. Should only run on tags. --- .github/workflows/test-and-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 944d318a..47827370 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -61,7 +61,7 @@ jobs: name: ${{ github.job }}-${{ github.run_id }}-${{ github.sha }} path: ./build/coverage.xml - name: Buid and Publish package - if: ${{ success() }} && github.event_name == 'push' && contains(github.ref, 'refs/tags/') + if: ${{ success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} run: | echo $(poetry run python --version) poetry publish --no-interaction --skip-existing --build --username __token__ --password $PYPI_API_TOKEN From 3bfb9676619f42f4d30905844cdc1310d88e25b9 Mon Sep 17 00:00:00 2001 From: Hamada-Distributed <113064343+Hamada-Distributed@users.noreply.github.com> Date: Mon, 29 May 2023 12:03:15 -0400 Subject: [PATCH 18/19] Update .github/workflows/test-and-publish.yaml Co-authored-by: Tom Wenzheng Tang --- .github/workflows/test-and-publish.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 47827370..e3219b47 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -64,4 +64,4 @@ jobs: if: ${{ success() && github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} run: | echo $(poetry run python --version) - poetry publish --no-interaction --skip-existing --build --username __token__ --password $PYPI_API_TOKEN + poetry publish --no-interaction --skip-existing --build --username __token__ --password ${{ secrets.PYPI_API_TOKEN }} From e091a73cd76517225140e9bff16f53838ef9be2c Mon Sep 17 00:00:00 2001 From: Hamada Gasmallah Date: Mon, 29 May 2023 16:41:01 -0400 Subject: [PATCH 19/19] CI: Run workflow only on main, pr's or tags --- .github/workflows/test-and-publish.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test-and-publish.yaml b/.github/workflows/test-and-publish.yaml index 47827370..626c9d18 100644 --- a/.github/workflows/test-and-publish.yaml +++ b/.github/workflows/test-and-publish.yaml @@ -2,6 +2,10 @@ name: 'Test and Publish Suite' on: push: + branches: + - main + tags: + - '*' workflow_call: workflow_dispatch: pull_request: