diff --git a/.github/workflows/Python_tests.yml b/.github/workflows/Python_tests.yml index 2fa01a417b..6ef59f4013 100644 --- a/.github/workflows/Python_tests.yml +++ b/.github/workflows/Python_tests.yml @@ -25,8 +25,8 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r requirements_dev.txt + python -m pip install --upgrade pip setuptools + pip install --editable ".[dev]" - name: Lint with flake8 run: flake8 . --ignore=E203,W503 --max-complexity=101 --max-line-length=88 --show-source --statistics - name: Test with pytest diff --git a/pylib/gyp/__init__.py b/pylib/gyp/__init__.py index 5c2f56ad12..6ac428c033 100755 --- a/pylib/gyp/__init__.py +++ b/pylib/gyp/__init__.py @@ -476,7 +476,8 @@ def gyp_main(args): options, build_files_arg = parser.parse_args(args) if options.version: - print(f"v{VERSION}") + import pkg_resources + print(f"v{pkg_resources.get_distribution('gyp-next').version}") return 0 build_files = build_files_arg diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..a76dbcb688 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,40 @@ +[build-system] +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "gyp-next" +version = "0.13.0" +authors = [ + { name="Node.js contributors", email="ryzokuken@disroot.org" }, +] +description = "A fork of the GYP build system for use in the Node.js projects" +readme = "README.md" +license = { file="LICENSE" } +requires-python = ">=3.6" +classifiers = [ + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", +] + +[project.optional-dependencies] +dev = ["flake8", "pytest"] + +[project.scripts] +gyp = "pylib.gyp:script_main" + +[project.urls] +"Homepage" = "https://github.com/nodejs/gyp-next" + +[tool.setuptools] +packages = ["pylib.gyp", "pylib.gyp.generator"] diff --git a/requirements_dev.txt b/requirements_dev.txt deleted file mode 100644 index 28ecacab60..0000000000 --- a/requirements_dev.txt +++ /dev/null @@ -1,2 +0,0 @@ -flake8 -pytest diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 320d20e6a9..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,33 +0,0 @@ -[metadata] -name = gyp-next -version = attr: gyp.VERSION -description = A fork of the GYP build system for use in the Node.js projects -long_description = file: README.md -long_description_content_type = text/markdown -author=Node.js contributors -author_email=ryzokuken@disroot.org -url=https://github.com/nodejs/gyp-next -license = BSD 3-Clause License -classifiers = - Development Status :: 3 - Alpha - Environment :: Console - Intended Audience :: Developers - License :: OSI Approved :: BSD License - Natural Language :: English - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - -[options] -python_requires = 3.6 -package_dir= - =pylib -packages=gyp,gyp.generator - -[options.entry_points] -console_scripts = - executable-name = gyp:script_main diff --git a/setup.py b/setup.py deleted file mode 100644 index 93efa20fc3..0000000000 --- a/setup.py +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python3 - -# Copyright (c) 2009 Google Inc. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -from setuptools import setup - - -setup()