From 59b4b4b4209042325e63982f92d4e2985578781c Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 21 Nov 2024 16:02:16 -0500 Subject: [PATCH 1/3] Run pytest after package installation --- .github/workflows/release.yml | 7 +------ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d1ebcc..0f0d84f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,15 +24,10 @@ jobs: curl -LsSf https://astral.sh/uv/install.sh | sh uv venv shell: bash - - name: Run all tests - run: | - source .venv/bin/activate - uv pip install ".[dev]" - pytest --headless - name: Generate distribution run: | source .venv/bin/activate - uv pip install -r requires-dev.txt -r requires-install.txt + uv pip install ".[dev]" npm i npm run dist npm pack && mv *.tgz dist/ diff --git a/package-lock.json b/package-lock.json index 0072581..9f04f4c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dash-ag-grid", - "version": "31.2.0", + "version": "31.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "dash-ag-grid", - "version": "31.2.0", + "version": "31.3.0", "license": "MIT", "dependencies": { "@emotion/react": "^11.11.3", diff --git a/package.json b/package.json index 65f4283..6bdc24c 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "private::lint.eslint": "eslint src", "private::lint.prettier": "prettier src --list-different --ignore-path=.prettierignore", "lint": "run-s private::lint.*", - "dist": "npm run build && run-s pre-flight-dag-version && rimraf build dist && python setup.py sdist bdist_wheel" + "dist": "npm run build && pytest --headless && run-s pre-flight-dag-version && rimraf build dist && python setup.py sdist bdist_wheel" }, "author": "Plotly ", "license": "MIT", From 5855435289b2d12bd9c2563e094ffbdfe349025d Mon Sep 17 00:00:00 2001 From: Nathan Date: Thu, 21 Nov 2024 16:11:58 -0500 Subject: [PATCH 2/3] Tests are optional for npm run dist --- .github/workflows/release.yml | 1 + package.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0f0d84f..e490c9a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,6 +29,7 @@ jobs: source .venv/bin/activate uv pip install ".[dev]" npm i + npm run test npm run dist npm pack && mv *.tgz dist/ shell: bash diff --git a/package.json b/package.json index 6bdc24c..63141aa 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "private::lint.eslint": "eslint src", "private::lint.prettier": "prettier src --list-different --ignore-path=.prettierignore", "lint": "run-s private::lint.*", - "dist": "npm run build && pytest --headless && run-s pre-flight-dag-version && rimraf build dist && python setup.py sdist bdist_wheel" + "test": "pytest --headless", + "dist": "npm run build && run-s pre-flight-dag-version && rimraf build dist && python setup.py sdist bdist_wheel" }, "author": "Plotly ", "license": "MIT", From b5b58e26d39596472cc006184e95a30113f7e5c8 Mon Sep 17 00:00:00 2001 From: Nathan Drezner Date: Fri, 22 Nov 2024 10:41:17 -0500 Subject: [PATCH 3/3] Clean up release workflow --- .github/workflows/release.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e490c9a..e227b2e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,19 +19,36 @@ jobs: - uses: actions/setup-python@v4 with: python-version: "3.10" - - name: Setup uv + - name: Setup dependencies + # Set up the virtual environment and install dev dependencies (JS & Python) run: | curl -LsSf https://astral.sh/uv/install.sh | sh uv venv - shell: bash - - name: Generate distribution - run: | source .venv/bin/activate uv pip install ".[dev]" npm i + shell: bash + - name: Run tests + # Run all tests before generating the distribution + run: | + source .venv/bin/activate + npm run build npm run test + shell: bash + - name: Generate distribution + # Run setup.py to generate the distribution + run: | + source .venv/bin/activate npm run dist npm pack && mv *.tgz dist/ + - name: Validate distribution + # Run tests again using the generated wheel file + run: | + uv venv test-dist + source dist/bin/activate + WHL_FILE=$(ls dist/*.whl) + uv pip install "${WHL_FILE}[dev]" + npm run test shell: bash - uses: ncipollo/release-action@v1 with: