Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add command line argument for gyp --version #164

Merged
merged 1 commit into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pylib/gyp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import traceback
from gyp.common import GypError


VERSION = "0.13.0"

# Default debug modes for GYP
debug = {}

Expand Down Expand Up @@ -463,8 +466,18 @@ def gyp_main(args):
metavar="TARGET",
help="include only TARGET and its deep dependencies",
)
parser.add_argument(
"-V",
"--version",
dest="version",
action="store_true",
help="Show the version and exit.",
)

options, build_files_arg = parser.parse_args(args)
if options.version:
print(f"v{VERSION}")
return 0
build_files = build_files_arg

# Set up the configuration directory (defaults to ~/.gyp)
Expand Down
33 changes: 33 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[metadata]
name = gyp-next
version = attr: pylib/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
[email protected]
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
34 changes: 1 addition & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from os import path

from setuptools import setup

here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.md")) as in_file:
long_description = in_file.read()

setup(
name="gyp-next",
version="0.13.0",
description="A fork of the GYP build system for use in the Node.js projects",
long_description=long_description,
long_description_content_type="text/markdown",
author="Node.js contributors",
author_email="[email protected]",
url="https://github.com/nodejs/gyp-next",
package_dir={"": "pylib"},
packages=["gyp", "gyp.generator"],
entry_points={"console_scripts": ["gyp=gyp:script_main"]},
python_requires=">=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",
],
)
setup()