diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e0c57b52..1ef9f6a30 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,34 +17,28 @@ jobs: fail-fast: false matrix: os: [ ubuntu, windows, macos ] - python-version: ['3.10', 3.11] - include: - - python-version: '3.10' - node-version: 16 - - python-version: 3.11 - node-version: 18 - - python-version: 3.11 - node-version: 20 + python-version: [ '3.10', 3.12, 3.14 ] + node-version: [ lts/*, lts/-1, lts-2 ] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Cached node_modules - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: node_modules key: ${{ runner.os }}-node-${{ hashFiles('**/package*.json') }} restore-keys: | ${{ runner.os }}-node- - name: Make all (Windows) - if: matrix.os == 'windows' + if: runner.os == 'Windows' run: make all - name: Make CI (Non-windows) - if: matrix.os != 'windows' + if: runner.os != 'Windows' run: make ci diff --git a/Makefile b/Makefile index 1ddfb5482..94b847fee 100644 --- a/Makefile +++ b/Makefile @@ -84,15 +84,17 @@ python/dist/*: $(BUILD_DIR)/python $(BUILD_DIR)/generate $(wildcard python/**/*. @rm -f python/dist/* @cd python && \ cp setup-css.py setup.py && \ + $(PYTHON) -m pip install 'setuptools; python_version >= "3.12"' && \ $(PYTHON) setup.py sdist && \ rm setup.py @cd python && \ cp setup-js.py setup.py && \ + $(PYTHON) -m pip install 'setuptools; python_version >= "3.12"' && \ $(PYTHON) setup.py sdist && \ rm setup.py # Order matters here! Install css then js to make sure the local dist version of js is used - $(SCRIPT_DIR)/python-rel pip install -U python/dist/cssbeautifier* - $(SCRIPT_DIR)/python-rel pip install -U python/dist/jsbeautifier* + $(SCRIPT_DIR)/python-rel pip install --upgrade python/dist/cssbeautifier* + $(SCRIPT_DIR)/python-rel pip install --upgrade python/dist/jsbeautifier* # python package generation build/*.tgz: js/lib/*.js diff --git a/python/setup-css.py b/python/setup-css.py index 560ad97a5..7cead8c94 100755 --- a/python/setup-css.py +++ b/python/setup-css.py @@ -18,6 +18,11 @@ "cssbeautifier.tests.generated", "cssbeautifier.css", ], - install_requires=["jsbeautifier", "six>=1.13.0", "editorconfig>=0.12.2"], + install_requires=[ + "jsbeautifier", + "six>=1.13.0", + "editorconfig>=0.12.2", + "setuptools; python_version >= '3.12'", + ], license="MIT", ) diff --git a/python/setup-js.py b/python/setup-js.py index 3da5d3d04..15fe5b6cb 100755 --- a/python/setup-js.py +++ b/python/setup-js.py @@ -25,6 +25,10 @@ "jsbeautifier.unpackers", "jsbeautifier.unpackers.tests", ], - install_requires=["six>=1.13.0", "editorconfig>=0.12.2"], + install_requires=[ + "six>=1.13.0", + "editorconfig>=0.12.2", + "setuptools; python_version >= '3.12'", + ], license="MIT", )