"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/utils/fixtures/setups/ansible/setup.py" between
poetry-1.1.15.tar.gz and poetry-1.2.0.tar.gz

About: Poetry is a tool for dependency management and packaging in Python.

setup.py  (poetry-1.1.15):setup.py  (poetry-1.2.0)
from __future__ import print_function from __future__ import annotations
import json import json
import os import os
import os.path import os.path
import re import re
import sys import sys
import warnings import warnings
from collections import defaultdict from collections import defaultdict
from distutils.command.build_scripts import build_scripts as BuildScripts from distutils.command.build_scripts import build_scripts as BuildScripts
from distutils.command.sdist import sdist as SDist from distutils.command.sdist import sdist as SDist
try: try:
from setuptools import setup, find_packages from setuptools import find_packages
from setuptools import setup
from setuptools.command.build_py import build_py as BuildPy from setuptools.command.build_py import build_py as BuildPy
from setuptools.command.install_lib import install_lib as InstallLib from setuptools.command.install_lib import install_lib as InstallLib
from setuptools.command.install_scripts import install_scripts as InstallScr ipts from setuptools.command.install_scripts import install_scripts as InstallScr ipts
except ImportError: except ImportError:
print( print(
"Ansible now needs setuptools in order to build. Install it using" "Ansible now needs setuptools in order to build. Install it using"
" your package manager (usually python-setuptools) or via pip (pip" " your package manager (usually python-setuptools) or via pip (pip"
" install setuptools).", " install setuptools).",
file=sys.stderr, file=sys.stderr,
) )
sys.exit(1) sys.exit(1)
sys.path.insert(0, os.path.abspath("lib")) sys.path.insert(0, os.path.abspath("lib"))
from ansible.release import __version__, __author__ from ansible.release import __author__
from ansible.release import __version__
SYMLINK_CACHE = "SYMLINK_CACHE.json" SYMLINK_CACHE = "SYMLINK_CACHE.json"
def _find_symlinks(topdir, extension=""): def _find_symlinks(topdir, extension=""):
"""Find symlinks that should be maintained """Find symlinks that should be maintained
Maintained symlinks exist in the bin dir or are modules which have Maintained symlinks exist in the bin dir or are modules which have
aliases. Our heuristic is that they are a link in a certain path which aliases. Our heuristic is that they are a link in a certain path which
point to a file in the same directory. point to a file in the same directory.
""" """
skipping to change at line 62 skipping to change at line 64
def _cache_symlinks(symlink_data): def _cache_symlinks(symlink_data):
with open(SYMLINK_CACHE, "w") as f: with open(SYMLINK_CACHE, "w") as f:
json.dump(symlink_data, f) json.dump(symlink_data, f)
def _maintain_symlinks(symlink_type, base_path): def _maintain_symlinks(symlink_type, base_path):
"""Switch a real file into a symlink""" """Switch a real file into a symlink"""
try: try:
# Try the cache first because going from git checkout to sdist is the # Try the cache first because going from git checkout to sdist is the
# only time we know that we're going to cache correctly # only time we know that we're going to cache correctly
with open(SYMLINK_CACHE, "r") as f: with open(SYMLINK_CACHE) as f:
symlink_data = json.load(f) symlink_data = json.load(f)
except (IOError, OSError) as e: except OSError as e:
# IOError on py2, OSError on py3. Both have errno # IOError on py2, OSError on py3. Both have errno
if e.errno == 2: if e.errno == 2:
# SYMLINKS_CACHE doesn't exist. Fallback to trying to create the # SYMLINKS_CACHE doesn't exist. Fallback to trying to create the
# cache now. Will work if we're running directly from a git # cache now. Will work if we're running directly from a git
# checkout or from an sdist created earlier. # checkout or from an sdist created earlier.
symlink_data = { symlink_data = {
"script": _find_symlinks("bin"), "script": _find_symlinks("bin"),
"library": _find_symlinks("lib", ".py"), "library": _find_symlinks("lib", ".py"),
} }
skipping to change at line 132 skipping to change at line 134
symlinks = { symlinks = {
"script": _find_symlinks("bin"), "script": _find_symlinks("bin"),
"library": _find_symlinks("lib", ".py"), "library": _find_symlinks("lib", ".py"),
} }
_cache_symlinks(symlinks) _cache_symlinks(symlinks)
SDist.run(self) SDist.run(self)
def read_file(file_name): def read_file(file_name):
"""Read file and return its contents.""" """Read file and return its contents."""
with open(file_name, "r") as f: with open(file_name) as f:
return f.read() return f.read()
def read_requirements(file_name): def read_requirements(file_name):
"""Read requirements file as a list.""" """Read requirements file as a list."""
reqs = read_file(file_name).splitlines() reqs = read_file(file_name).splitlines()
if not reqs: if not reqs:
raise RuntimeError( raise RuntimeError(
"Unable to read requirements from the %s file" "Unable to read requirements from the %s file"
"That indicates this copy of the source code is incomplete." % file_ name "That indicates this copy of the source code is incomplete." % file_ name
) )
 End of changes. 6 change blocks. 
6 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)