classification
Title: Cannot initialize the distutils "force" command-option
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.8, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Opher Shachar, dstufft, eric.araujo, steve.dower
Priority: normal Keywords: patch, patch, patch, patch

Created on 2019-01-11 16:01 by Opher Shachar, last changed 2021-02-03 18:16 by steve.dower. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11526 closed Opher Shachar, 2019-01-11 18:14
PR 11526 closed Opher Shachar, 2019-01-11 18:14
PR 11526 closed Opher Shachar, 2019-01-11 18:14
PR 11526 closed Opher Shachar, 2019-01-11 18:14
Messages (4)
msg333481 - (view) Author: Opher Shachar (Opher Shachar) * Date: 2019-01-11 16:01
When creating a custom Command (or sub-classing one) we cannot initialize in "initialize_options()" the "force" option to 1, because Command.__init__ resets it to None after the call to self.initialize_options().
msg333495 - (view) Author: √Čric Araujo (eric.araujo) * (Python committer) Date: 2019-01-11 18:16
Could you tell how you found the problem, i.e. what are you trying to do?
msg333500 - (view) Author: Opher Shachar (Opher Shachar) * Date: 2019-01-11 19:19
(from the PR11526)
In this build_py subclass I initialize force to 1, but when reaching byte_compile() we find out it was reset to None.

from setuptools.command.build_py import build_py as _build_py

class build_py(_build_py):
    def initialize_options(self):
        _build_py.initialize_options(self)
        self.force = 1
        self.compile = 1

    def byte_compile(self, files):
        # self.compile == 1
        # self.force == None
        _build_py.byte_compile(self, files)
        # do stuff...
msg386314 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:16
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date User Action Args
2021-02-03 18:16:27steve.dowersetstatus: open -> closed


keywords: patch, patch, patch, patch
nosy: + steve.dower
messages: + msg386314
resolution: out of date
stage: patch review -> resolved
2019-01-11 21:54:02terry.reedysetkeywords: patch, patch, patch, patch
title: Cannot initialize the "force" command-option -> Cannot initialize the distutils "force" command-option
2019-01-11 19:19:13Opher Shacharsetmessages: + msg333500
2019-01-11 18:16:26eric.araujosetkeywords: patch, patch, patch, patch

messages: + msg333495
2019-01-11 18:14:47Opher Shacharsetkeywords: + patch
stage: patch review
pull_requests: + pull_request11111
2019-01-11 18:14:40Opher Shacharsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request11112
2019-01-11 18:14:35Opher Shacharsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request11110
2019-01-11 18:14:28Opher Shacharsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request11109
2019-01-11 16:01:26Opher Shacharcreate