From 592269afeaa4f96bddbaa8b6fbe8dddcea2445a4 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Fri, 8 Jul 2005 04:48:20 +0000 Subject: * Added "rotate" command to delete old distribution files, given a set of patterns to match and the number of files to keep. (Keeps the most recently-modified distribution files matching each pattern.) * Added "saveopts" command that saves all command-line options for the current invocation to the local, global, or per-user configuration file. Useful for setting defaults without having to hand-edit a configuration file. * Added a "setopt" command that sets a single option in a specified distutils configuration file. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041093 --- setuptools/command/setopt.py | 164 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100755 setuptools/command/setopt.py (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py new file mode 100755 index 00000000..b5d9d307 --- /dev/null +++ b/setuptools/command/setopt.py @@ -0,0 +1,164 @@ +import distutils, os +from setuptools import Command +from distutils.util import convert_path +from distutils import log +from distutils.errors import * + +__all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] + + +def config_file(kind="local"): + """Get the filename of the distutils, local, global, or per-user config + + `kind` must be one of "local", "global", or "user" + """ + if kind=='local': + return 'setup.cfg' + if kind=='global': + return os.path.join( + os.path.dirname(distutils.__file__),'distutils.cfg' + ) + if kind=='user': + dot = os.name=='posix' and '.' or '' + return os.path.expanduser(convert_path("~/%spydistutils.cfg" % dot)) + raise ValueError( + "config_file() type must be 'local', 'global', or 'user'", kind + ) + + + + + + + + + + + + + + + +def edit_config(filename, settings, dry_run=False): + """Edit a configuration file to include `settings` + + `settings` is a dictionary of dictionaries or ``None`` values, keyed by + command/section name. A ``None`` value means to delete the entire section, + while a dictionary lists settings to be changed or deleted in that section. + A setting of ``None`` means to delete that setting. + """ + from ConfigParser import RawConfigParser + log.debug("Reading configuration from %s", filename) + opts = RawConfigParser() + opts.read([filename]) + + for section, options in settings.items(): + if options is None: + log.debug("Deleting section [%s] from %s", section, filename) + opts.remove_section(section) + else: + if not opts.has_section(section): + log.debug("Adding new section [%s] to %s", section, filename) + opts.add_section(section) + for option,value in options.items(): + if value is None: + log.debug("Deleting %s.%s from %s", + section, option, filename + ) + opts.remove_option(section,option) + else: + log.debug( + "Setting %s.%s to %r in %s", + section, option, value, filename + ) + opts.set(section,option,value) + + log.info("Writing %s", filename) + if not dry_run: + f = open(filename,'w') + opts.write(f) + f.close() + + +class option_base(Command): + """Abstract base class for commands that mess with config files""" + + user_options = [ + ('filename=', 'f', + "set the file to use (default=setup.cfg)"), + ('global-config', 'g', + "save options to the site-wide distutils.cfg file"), + ('user-config', 'u', + "save options to the current user's pydistutils.cfg file"), + ] + + boolean_options = [ + 'global-config', 'user-config', + ] + + def initialize_options(self): + self.global_config = None + self.user_config = None + self.filename = None + + def finalize_options(self): + filenames = [] + if self.global_config: + filenames.append(config_file('global')) + if self.user_config: + filenames.append(config_file('user')) + if self.filename is not None: + filenames.append(self.filename) + if not filenames: + filenames.append(config_file('local')) + if len(filenames)>1: + raise DistutilsOptionError( + "Must specify only one configuration file option", + filenames + ) + self.filename, = filenames + + + + +class setopt(option_base): + """Save command-line options to a file""" + + description = "set an option in setup.cfg or another config file" + + user_options = option_base.user_options + [ + ('command=', 'c', 'command to set an option for'), + ('option=', 'o', 'option to set'), + ('set-value=', 's', 'value of the option'), + ('remove', 'r', 'unset the value'), + ] + + boolean_options = option_base.boolean_options + ['remove'] + + def initialize_options(self): + option_base.initialize_options(self) + self.command = None + self.option = None + self.set_value = None + self.remove = None + + def finalize_options(self): + option_base.finalize_options(self) + if self.command is None or self.option is None: + raise DistutilsOptionError("Must specify --command *and* --option") + if self.set_value is None and not self.remove: + raise DistutilsOptionError("Must specify --set-value or --remove") + + def run(self): + edit_config( + self.filename, { + self.command: {self.option.replace('-','_'):self.set_value} + }, + self.dry_run + ) + + + + + + -- cgit v1.2.1 From 6050f5361738831a12debd373b9016a077e930df Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Fri, 8 Jul 2005 05:09:23 +0000 Subject: Added support for defining command aliases in distutils configuration files, under the "[aliases]" section. To prevent recursion and to allow aliases to call the command of the same name, a given alias can be expanded only once per command-line invocation. You can define new aliases with the "alias" command, either for the local, global, or per-user configuration. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041094 --- setuptools/command/setopt.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index b5d9d307..3af0753f 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -84,12 +84,12 @@ class option_base(Command): """Abstract base class for commands that mess with config files""" user_options = [ - ('filename=', 'f', - "set the file to use (default=setup.cfg)"), ('global-config', 'g', "save options to the site-wide distutils.cfg file"), ('user-config', 'u', "save options to the current user's pydistutils.cfg file"), + ('filename=', 'f', + "configuration file to use (default=setup.cfg)"), ] boolean_options = [ @@ -126,12 +126,12 @@ class setopt(option_base): description = "set an option in setup.cfg or another config file" - user_options = option_base.user_options + [ + user_options = [ ('command=', 'c', 'command to set an option for'), ('option=', 'o', 'option to set'), ('set-value=', 's', 'value of the option'), - ('remove', 'r', 'unset the value'), - ] + ('remove', 'r', 'remove (unset) the value'), + ] + option_base.user_options boolean_options = option_base.boolean_options + ['remove'] -- cgit v1.2.1 From d798d6943f81d938581c37b431b141b013678021 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Fri, 8 Jul 2005 15:50:32 +0000 Subject: Delete empty sections when their last option is deleted. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041099 --- setuptools/command/setopt.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index 3af0753f..dbf3a94e 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -51,10 +51,9 @@ def edit_config(filename, settings, dry_run=False): log.debug("Reading configuration from %s", filename) opts = RawConfigParser() opts.read([filename]) - for section, options in settings.items(): if options is None: - log.debug("Deleting section [%s] from %s", section, filename) + log.info("Deleting section [%s] from %s", section, filename) opts.remove_section(section) else: if not opts.has_section(section): @@ -66,6 +65,10 @@ def edit_config(filename, settings, dry_run=False): section, option, filename ) opts.remove_option(section,option) + if not opts.options(section): + log.info("Deleting empty [%s] section from %s", + section, filename) + opts.remove_section(section) else: log.debug( "Setting %s.%s to %r in %s", @@ -75,10 +78,7 @@ def edit_config(filename, settings, dry_run=False): log.info("Writing %s", filename) if not dry_run: - f = open(filename,'w') - opts.write(f) - f.close() - + f = open(filename,'w'); opts.write(f); f.close() class option_base(Command): """Abstract base class for commands that mess with config files""" -- cgit v1.2.1 From 58a658b26d1c95b31d02050dcccd648d2e4ce27b Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Mon, 20 Jun 2011 22:55:16 +0100 Subject: Changes to support 2.x and 3.x in the same codebase. --HG-- branch : distribute extra : rebase_source : 7d3608edee54a43789f0574d702fb839628b5071 --- setuptools/command/setopt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index dbf3a94e..aa468c88 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -47,9 +47,9 @@ def edit_config(filename, settings, dry_run=False): while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. """ - from ConfigParser import RawConfigParser + from setuptools.compat import ConfigParser log.debug("Reading configuration from %s", filename) - opts = RawConfigParser() + opts = ConfigParser.RawConfigParser() opts.read([filename]) for section, options in settings.items(): if options is None: -- cgit v1.2.1 From 8c7d2e1f80901375a50a99d1903386c29a423f26 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 9 Feb 2014 18:54:45 -0500 Subject: Normalize whitespace and imports --- setuptools/command/setopt.py | 51 ++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 35 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index aa468c88..575653c8 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -1,8 +1,9 @@ -import distutils, os +import os +import distutils from setuptools import Command from distutils.util import convert_path from distutils import log -from distutils.errors import * +from distutils.errors import DistutilsOptionError __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] @@ -25,20 +26,6 @@ def config_file(kind="local"): "config_file() type must be 'local', 'global', or 'user'", kind ) - - - - - - - - - - - - - - def edit_config(filename, settings, dry_run=False): """Edit a configuration file to include `settings` @@ -61,13 +48,14 @@ def edit_config(filename, settings, dry_run=False): opts.add_section(section) for option,value in options.items(): if value is None: - log.debug("Deleting %s.%s from %s", + log.debug( + "Deleting %s.%s from %s", section, option, filename ) opts.remove_option(section,option) if not opts.options(section): log.info("Deleting empty [%s] section from %s", - section, filename) + section, filename) opts.remove_section(section) else: log.debug( @@ -78,27 +66,28 @@ def edit_config(filename, settings, dry_run=False): log.info("Writing %s", filename) if not dry_run: - f = open(filename,'w'); opts.write(f); f.close() + with open(filename, 'w') as f: + opts.write(f) class option_base(Command): """Abstract base class for commands that mess with config files""" - + user_options = [ ('global-config', 'g', - "save options to the site-wide distutils.cfg file"), + "save options to the site-wide distutils.cfg file"), ('user-config', 'u', - "save options to the current user's pydistutils.cfg file"), + "save options to the current user's pydistutils.cfg file"), ('filename=', 'f', - "configuration file to use (default=setup.cfg)"), + "configuration file to use (default=setup.cfg)"), ] boolean_options = [ 'global-config', 'user-config', - ] + ] def initialize_options(self): self.global_config = None - self.user_config = None + self.user_config = None self.filename = None def finalize_options(self): @@ -116,9 +105,7 @@ class option_base(Command): "Must specify only one configuration file option", filenames ) - self.filename, = filenames - - + self.filename, = filenames class setopt(option_base): @@ -130,7 +117,7 @@ class setopt(option_base): ('command=', 'c', 'command to set an option for'), ('option=', 'o', 'option to set'), ('set-value=', 's', 'value of the option'), - ('remove', 'r', 'remove (unset) the value'), + ('remove', 'r', 'remove (unset) the value'), ] + option_base.user_options boolean_options = option_base.boolean_options + ['remove'] @@ -156,9 +143,3 @@ class setopt(option_base): }, self.dry_run ) - - - - - - -- cgit v1.2.1 From 8e3f9d3253d1d0fb820dad4249d5110d017595c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Wed, 18 Jun 2014 20:31:05 +0300 Subject: Fixed PEP 8 compliancy of the setuptools.command package --- setuptools/command/setopt.py | 45 ++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index 575653c8..a04d6032 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -1,9 +1,11 @@ -import os -import distutils -from setuptools import Command from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError +import distutils +import os + +from setuptools import Command + __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] @@ -13,19 +15,20 @@ def config_file(kind="local"): `kind` must be one of "local", "global", or "user" """ - if kind=='local': + if kind == 'local': return 'setup.cfg' - if kind=='global': + if kind == 'global': return os.path.join( - os.path.dirname(distutils.__file__),'distutils.cfg' + os.path.dirname(distutils.__file__), 'distutils.cfg' ) - if kind=='user': - dot = os.name=='posix' and '.' or '' + if kind == 'user': + dot = os.name == 'posix' and '.' or '' return os.path.expanduser(convert_path("~/%spydistutils.cfg" % dot)) raise ValueError( "config_file() type must be 'local', 'global', or 'user'", kind ) + def edit_config(filename, settings, dry_run=False): """Edit a configuration file to include `settings` @@ -35,6 +38,7 @@ def edit_config(filename, settings, dry_run=False): A setting of ``None`` means to delete that setting. """ from setuptools.compat import ConfigParser + log.debug("Reading configuration from %s", filename) opts = ConfigParser.RawConfigParser() opts.read([filename]) @@ -46,39 +50,40 @@ def edit_config(filename, settings, dry_run=False): if not opts.has_section(section): log.debug("Adding new section [%s] to %s", section, filename) opts.add_section(section) - for option,value in options.items(): + for option, value in options.items(): if value is None: log.debug( "Deleting %s.%s from %s", section, option, filename ) - opts.remove_option(section,option) + opts.remove_option(section, option) if not opts.options(section): log.info("Deleting empty [%s] section from %s", - section, filename) + section, filename) opts.remove_section(section) else: log.debug( "Setting %s.%s to %r in %s", section, option, value, filename ) - opts.set(section,option,value) + opts.set(section, option, value) log.info("Writing %s", filename) if not dry_run: with open(filename, 'w') as f: opts.write(f) + class option_base(Command): """Abstract base class for commands that mess with config files""" user_options = [ ('global-config', 'g', - "save options to the site-wide distutils.cfg file"), + "save options to the site-wide distutils.cfg file"), ('user-config', 'u', - "save options to the current user's pydistutils.cfg file"), + "save options to the current user's pydistutils.cfg file"), ('filename=', 'f', - "configuration file to use (default=setup.cfg)"), + "configuration file to use (default=setup.cfg)"), ] boolean_options = [ @@ -100,7 +105,7 @@ class option_base(Command): filenames.append(self.filename) if not filenames: filenames.append(config_file('local')) - if len(filenames)>1: + if len(filenames) > 1: raise DistutilsOptionError( "Must specify only one configuration file option", filenames @@ -115,9 +120,9 @@ class setopt(option_base): user_options = [ ('command=', 'c', 'command to set an option for'), - ('option=', 'o', 'option to set'), - ('set-value=', 's', 'value of the option'), - ('remove', 'r', 'remove (unset) the value'), + ('option=', 'o', 'option to set'), + ('set-value=', 's', 'value of the option'), + ('remove', 'r', 'remove (unset) the value'), ] + option_base.user_options boolean_options = option_base.boolean_options + ['remove'] @@ -139,7 +144,7 @@ class setopt(option_base): def run(self): edit_config( self.filename, { - self.command: {self.option.replace('-','_'):self.set_value} + self.command: {self.option.replace('-', '_'): self.set_value} }, self.dry_run ) -- cgit v1.2.1 From b49435397a5094f94678adf3549cc8941aa469b7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 5 Jul 2014 15:06:51 -0400 Subject: Use six for Python 2 compatibility --HG-- branch : feature/issue-229 extra : source : 7b1997ececc5772798ce33a0f8e77387cb55a977 --- setuptools/command/setopt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index a04d6032..f78e0cd5 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -4,6 +4,8 @@ from distutils.errors import DistutilsOptionError import distutils import os +from six.moves import configparser + from setuptools import Command @@ -37,10 +39,8 @@ def edit_config(filename, settings, dry_run=False): while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. """ - from setuptools.compat import ConfigParser - log.debug("Reading configuration from %s", filename) - opts = ConfigParser.RawConfigParser() + opts = configparser.RawConfigParser() opts.read([filename]) for section, options in settings.items(): if options is None: -- cgit v1.2.1 From 06872bb0bbbeb953e90bd0941444b0d499056557 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 31 Dec 2015 11:51:01 -0500 Subject: Update vendoring technique to match that used for packaging. Ref #229. --HG-- branch : feature/issue-229 --- setuptools/command/setopt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index f78e0cd5..1441e512 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -4,7 +4,12 @@ from distutils.errors import DistutilsOptionError import distutils import os -from six.moves import configparser +try: + from setuptools._vendor.six.moves import configparser +except ImportError: + # fallback to naturally-installed version; allows system packagers to + # omit vendored packages. + from six.moves import configparser from setuptools import Command -- cgit v1.2.1 From 952c1bafda1929c74c737646aa025e6ffad6632e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 31 Dec 2015 16:30:47 -0500 Subject: Modeling after Astropy's technique for bundling libraries, the imports are now much cleaner. Thanks @embray. Ref #229. --HG-- branch : feature/issue-229 --- setuptools/command/setopt.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index 1441e512..7f332be5 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -4,12 +4,7 @@ from distutils.errors import DistutilsOptionError import distutils import os -try: - from setuptools._vendor.six.moves import configparser -except ImportError: - # fallback to naturally-installed version; allows system packagers to - # omit vendored packages. - from six.moves import configparser +from setuptools.extern.six.moves import configparser from setuptools import Command -- cgit v1.2.1 From df05ebf3e88858ae7ac74071bd20c86782e1415d Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Mon, 18 Apr 2016 15:08:49 -0400 Subject: Preserve order of egg_info section in setup.cfg egg_info is the dictionary with information that is injected into setup.cfg. edit_config uses RawConfigParser which uses collections.OrderedDict for all the data. When we use a simple dict(), when we loop through items in edit_config, we see random behavior as a result the fields tag_svn_revision/tag_date/tag_build are added to the setup.cfg randomly. So if we sort the items by key when we traverse items we will get deterministic output as RawConfigParser uses OrderedDict internally by default. --- setuptools/command/setopt.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index 7f332be5..912da782 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -2,6 +2,7 @@ from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import distutils +import operator import os from setuptools.extern.six.moves import configparser @@ -42,7 +43,8 @@ def edit_config(filename, settings, dry_run=False): log.debug("Reading configuration from %s", filename) opts = configparser.RawConfigParser() opts.read([filename]) - for section, options in settings.items(): + for section, options in sorted(settings.items(), + key=operator.itemgetter(0)): if options is None: log.info("Deleting section [%s] from %s", section, filename) opts.remove_section(section) @@ -50,7 +52,8 @@ def edit_config(filename, settings, dry_run=False): if not opts.has_section(section): log.debug("Adding new section [%s] to %s", section, filename) opts.add_section(section) - for option, value in options.items(): + for option, value in sorted(options.items(), + key=operator.itemgetter(0)): if value is None: log.debug( "Deleting %s.%s from %s", -- cgit v1.2.1 From 085247fa441f9b0fac05117ca1a3283e3510fb32 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 20 Apr 2016 09:25:21 -0400 Subject: Use OrderedDict to retain deterministic ordering of version info in egg_info command. Remove lexicographic ordering in setopt.edit_config. Ref #553 --- setuptools/command/setopt.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index 912da782..7f332be5 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -2,7 +2,6 @@ from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import distutils -import operator import os from setuptools.extern.six.moves import configparser @@ -43,8 +42,7 @@ def edit_config(filename, settings, dry_run=False): log.debug("Reading configuration from %s", filename) opts = configparser.RawConfigParser() opts.read([filename]) - for section, options in sorted(settings.items(), - key=operator.itemgetter(0)): + for section, options in settings.items(): if options is None: log.info("Deleting section [%s] from %s", section, filename) opts.remove_section(section) @@ -52,8 +50,7 @@ def edit_config(filename, settings, dry_run=False): if not opts.has_section(section): log.debug("Adding new section [%s] to %s", section, filename) opts.add_section(section) - for option, value in sorted(options.items(), - key=operator.itemgetter(0)): + for option, value in options.items(): if value is None: log.debug( "Deleting %s.%s from %s", -- cgit v1.2.1 From 31bd37c6ac8de9e8c1bacebc2d8e1215df91eb96 Mon Sep 17 00:00:00 2001 From: stepshal Date: Tue, 18 Oct 2016 20:24:35 +0700 Subject: Fix quantity of blank lines. --- setuptools/command/setopt.py | 1 - 1 file changed, 1 deletion(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index 7f332be5..7e57cc02 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -8,7 +8,6 @@ from setuptools.extern.six.moves import configparser from setuptools import Command - __all__ = ['config_file', 'edit_config', 'option_base', 'setopt'] -- cgit v1.2.1 From ff371f18f0076bc63da05334f7e551c1cc29e10d Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 1 Jan 2017 22:34:28 -0500 Subject: Strip out vendored packages and require them instead. Ref #581. --- setuptools/command/setopt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index 7e57cc02..6f6298c4 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -4,7 +4,7 @@ from distutils.errors import DistutilsOptionError import distutils import os -from setuptools.extern.six.moves import configparser +from six.moves import configparser from setuptools import Command -- cgit v1.2.1 From 3d0cc355fb5e8012cb8c72f0e25042a5a44f31d6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 24 Feb 2017 11:49:51 -0500 Subject: Revert "Merge pull request #933 from pypa/feature/581-depend-not-bundle" This reverts commit 089cdeb489a0fa94d11b7307b54210ef9aa40511, reversing changes made to aaec654d804cb78dbb6391afff721a63f26a71cd. --- setuptools/command/setopt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index 6f6298c4..7e57cc02 100755 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -4,7 +4,7 @@ from distutils.errors import DistutilsOptionError import distutils import os -from six.moves import configparser +from setuptools.extern.six.moves import configparser from setuptools import Command -- cgit v1.2.1 From 760e2e1df9c9c9d1fc072e7b6ad9df4c32bfc835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 27 Jul 2018 14:36:34 +0200 Subject: Remove spurious executable permissions --- setuptools/command/setopt.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 setuptools/command/setopt.py (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py old mode 100755 new mode 100644 -- cgit v1.2.1 From fb7ab81a3d080422687bad71f9ae9d36eeefbee2 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 16 Aug 2020 00:29:24 -0400 Subject: Remove Python 2 compatibility --- setuptools/command/setopt.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index 7e57cc02..e18057c8 100644 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -3,8 +3,7 @@ from distutils import log from distutils.errors import DistutilsOptionError import distutils import os - -from setuptools.extern.six.moves import configparser +import configparser from setuptools import Command -- cgit v1.2.1 From 2fdeb12fa5c252f2cfe8f7dcc1840bfefc712aa8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Wed, 8 Sep 2021 21:17:56 -0400 Subject: Retain case in setup.cfg during sdist. Fixes #2773. --- setuptools/command/setopt.py | 1 + 1 file changed, 1 insertion(+) (limited to 'setuptools/command/setopt.py') diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index e18057c8..6358c045 100644 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -39,6 +39,7 @@ def edit_config(filename, settings, dry_run=False): """ log.debug("Reading configuration from %s", filename) opts = configparser.RawConfigParser() + opts.optionxform = lambda x: x opts.read([filename]) for section, options in settings.items(): if options is None: -- cgit v1.2.1