"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/pymod/setup.py" between
pacparser-1.3.8.tar.gz and pacparser-1.3.9.tar.gz

About: pacparser is a library to parse Proxy Auto-Config (PAC) files (incl. a pactester).

setup.py  (pacparser-1.3.8):setup.py  (pacparser-1.3.9)
skipping to change at line 28 skipping to change at line 28
# You should have received a copy of the GNU Lesser General Public # You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software # License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA. # USA.
""" """
Wrapper script around python module Makefiles. This script take care of Wrapper script around python module Makefiles. This script take care of
identifying python setup and setting up some environment variables needed by identifying python setup and setting up some environment variables needed by
Makefiles. Makefiles.
""" """
import sys import glob
import os import os
import platform
import re
import shutil
import subprocess
import sys
from unittest.mock import patch from unittest.mock import patch
import distutils import distutils
from setuptools import setup, Extension from setuptools import setup, Extension
import distutils.cmd
def setup_dir():
return os.path.dirname(os.path.join(os.getcwd(), sys.argv[0]))
def module_path():
py_ver = '.'.join([str(x) for x in sys.version_info[0:2]])
return glob.glob(os.path.join(setup_dir(), 'build', 'lib*%s' % py_ver))[0]
def sanitize_version(ver):
ver = ver.strip()
# Strip first 'v' and last part from git provided versions.
# For example, v1.3.8-12-g231 becomes v1.3.8-12.
ver = re.sub(r'^v?([\d]+\.[\d]+\.[\d]+(-[\d]+)).*$', '\\1', ver)
# 1.3.8-12 becomes 1.3.8.dev12
return ver.replace('-', '.dev')
def git_version():
return sanitize_version(subprocess.check_output(
'git describe --always --tags --candidate=100'.split(' '),
text=True
))
def pacparser_version():
if subprocess.call('git rev-parse --git-dir'.split(' '),
stderr=subprocess.DEVNULL) == 0:
return git_version()
# Check if we have version.mk. It's added in the manual release tarball.
version_file = os.path.join(setup_dir(), '..', 'version.mk')
if os.path.exists(version_file):
with open(version_file) as f:
return sanitize_version(f.read().replace('VERSION=',''))
return sanitize_version(os.environ.get('PACPARSER_VERSION', '1.0.0'))
class DistCmd(distutils.cmd.Command):
"""Build pacparser python distribution."""
description = 'Build pacparser python distribution.'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
py_ver = '.'.join([str(x) for x in sys.version_info[0:2]])
pp_ver = pacparser_version()
mach = platform.machine().lower()
if mach == 'x86_64':
mach = 'amd64'
dist = 'pacparser-python%s-%s-%s-%s' % (
py_ver.replace('.',''), pp_ver, platform.system().lower(), mach)
if os.path.exists(dist):
shutil.rmtree(dist)
os.mkdir(dist)
shutil.copytree(os.path.join(module_path(), 'pacparser'),
dist+'/pacparser',
ignore=shutil.ignore_patterns('*pycache*'))
@patch('distutils.cygwinccompiler.get_msvcr') @patch('distutils.cygwinccompiler.get_msvcr')
def main(patched_func): def main(patched_func):
pacparser_version = os.environ.get('PACPARSER_VERSION', '1.0.0')
python_home = os.path.dirname(sys.executable) python_home = os.path.dirname(sys.executable)
extra_objects = ['pacparser.o', 'libjs.a'] extra_objects = []
obj_search_path = {
'pacparser.o': ['..', '.'],
'libjs.a': ['../spidermonkey', '.'],
}
for obj, paths in obj_search_path.items():
for path in paths:
if os.path.exists(os.path.join(path, obj)):
extra_objects.append(os.path.join(path, obj))
break
libraries = [] libraries = []
extra_link_args = [] extra_link_args = []
if sys.platform == 'win32': if sys.platform == 'win32':
extra_objects = ['../pacparser.o', '../spidermonkey/js.lib'] extra_objects = ['../pacparser.o', '../spidermonkey/js.lib']
libraries = ['ws2_32'] libraries = ['ws2_32']
# python_home has vcruntime140.dll # python_home has vcruntime140.dll
patched_func.return_value = ['vcruntime140'] patched_func.return_value = ['vcruntime140']
extra_link_args = ['-static-libgcc', '-L'+python_home] extra_link_args = ['-static-libgcc', '-L'+python_home]
pacparser_module = Extension('_pacparser', pacparser_module = Extension('_pacparser',
include_dirs = ['../spidermonkey/js/src', '..'], include_dirs = ['..'],
sources = ['pacparser_py.c'], sources = ['pacparser_py.c'],
libraries = libraries, libraries = libraries,
extra_link_args = extra_link_args, extra_link_args = extra_link_args,
extra_objects = extra_objects) extra_objects = extra_objects)
setup (name = 'pacparser', setup (
version = pacparser_version, cmdclass={
description = 'Pacparser package', 'dist': DistCmd,
author = 'Manu Garg', },
author_email = 'manugarg@gmail.com', name = 'pacparser',
url = 'http://github.com/pacparser/pacparser', version = pacparser_version(),
long_description = 'python library to parse proxy auto-config (PAC) ' description = 'Pacparser package',
'files.', author = 'Manu Garg',
package_data = {'': ['pacparser.o', 'libjs.a']}, author_email = 'manugarg@gmail.com',
license = 'LGPL', url = 'http://github.com/manugarg/pacparser',
ext_package = 'pacparser', long_description = ('python library to parse proxy auto-config (PAC) '
ext_modules = [pacparser_module], 'files.'),
py_modules = ['pacparser.__init__']) license = 'LGPL',
ext_package = 'pacparser',
ext_modules = [pacparser_module],
py_modules = ['pacparser.__init__'])
if __name__ == '__main__': if __name__ == '__main__':
main() main()
 End of changes. 7 change blocks. 
17 lines changed or deleted 99 lines changed or added

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