Skip to content

Commit

Permalink
fix setup.py test and issue deprecation warning (yaml#820)
Browse files Browse the repository at this point in the history
* direct invocation of `setup.py` commands has been long deprecated by setuptools
  • Loading branch information
nitzmahone authored Aug 6, 2024
1 parent a2d19c0 commit f74f335
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

NAME = 'PyYAML'
VERSION = '6.0.1'
VERSION = '7.0.0.dev0'
DESCRIPTION = "YAML parser and emitter for Python"
LONG_DESCRIPTION = """\
YAML is a data serialization format designed for human readability
Expand Down Expand Up @@ -28,8 +28,6 @@
"Programming Language :: Cython",
"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",
Expand Down Expand Up @@ -301,6 +299,11 @@ def run(self):
tempdir = tempfile.TemporaryDirectory(prefix='test_pyyaml')

try:
warnings.warn(
"Direct invocation of `setup.py` is deprecated by `setuptools` and will be removed in a future release. PyYAML tests should be run via `pytest`.",
DeprecationWarning,
)

# have to create a subdir since we don't get dir_exists_ok on copytree until 3.8
temp_test_path = pathlib.Path(tempdir.name) / 'pyyaml'
shutil.copytree(build_cmd.build_lib, temp_test_path)
Expand Down Expand Up @@ -352,5 +355,5 @@ def run(self):

distclass=Distribution,
cmdclass=cmdclass,
python_requires='>=3.6',
python_requires='>=3.8',
)

0 comments on commit f74f335

Please sign in to comment.