classification
Title: Make .pypirc handle multiple servers
Type: feature request
Components: Distutils Versions: Python 3.0, Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, christian.heimes, tarek
Priority: normal Keywords: patch

Created on 2008-01-17 12:32 by tarek, last changed 2008-05-11 14:01 by akuchling.

Files
File name Uploaded Description Edit Remove
distutils.2008.03.12.patch tarek, 2008-03-12 20:01
Messages
msg60025 (view) Author: Tarek Ziadé (tarek) Date: 2008-01-17 12:32
explained here: http://wiki.python.org/moin/EnhancedPyPI

The patch also adds unit tests for command/register.py and
command/upload.py
msg60058 (view) Author: Christian Heimes (christian.heimes) Date: 2008-01-17 20:48
I've changed the target version to 2.6+. We can't add new features to
2.5 and earlier.
msg62687 (view) Author: Tarek Ziadé (tarek) Date: 2008-02-22 14:47
please could you remove the deprecated patch.diff ? thanks :)
msg62752 (view) Author: Tarek Ziadé (tarek) Date: 2008-02-23 15:36
The last patch also fixes the HOME issues under Windows: #1531505,
#1741, #2166 where .pypirc and .pydistutils.cfg were not found. It is
not using os.path.expanduser to simplify the code usage (~\/ is rather
unreadable) (see the get_home() function in util.py)
msg62759 (view) Author: Tarek Ziadé (tarek) Date: 2008-02-23 15:59
I have changed the patch so it uses expanduser (took back tiran's
example from #2166)
msg62838 (view) Author: A.M. Kuchling (akuchling) Date: 2008-02-23 23:15
Random notes on bugday.distutils.patch:

* dist.py: this change should definitely be applied, no matter what 
  happens to the rest of the patch.

* Yay!  Lots of tests!

* distutils.pypirc: I'm doubtful of the finalize_options() here;
  looking for '-r' in the args seems like it could get confused 
  if there are packages or other arguments that just happen
  to use that name.  It seems like a remote possibility, but still...

* distutils.pypirc: Class name typo in module docstring.
  
* Would the distutils.pypirc module be better named something like
  distutils.config?

* register.py: why use PyPIRCCommand.DEFAULT_REPOSITORY 
  and not register.DEFAULT_REPOSITORY?  I guess it's more useful to
  have a single Distutil-wide default repository.  No action needed.
msg62839 (view) Author: A.M. Kuchling (akuchling) Date: 2008-02-23 23:19
* I like factoring out the .pypirc code into a separate class.

* Overall I think the patch is acceptable.  We'd need to decide whether
  the new .pypirc is considered suitable -- I don't remember the reaction
  to it on the distutils-sig or catalog-sig -- but this patch seems
  like a decent implementation of the new format.
msg62948 (view) Author: Tarek Ziadé (tarek) Date: 2008-02-24 22:15
for the -r option, is has to be catched by both register and upload when
the command is called like this :

  $ python setup.py register sdist upload -r my-pypi

without the args lookup, register will get an empty value for -r. 

This option seems to me quite global to distutils.
msg63296 (view) Author: Tarek Ziadé (tarek) Date: 2008-03-05 21:54
I have changed the code: the pypirc module is now called config.
msg63457 (view) Author: Tarek Ziadé (tarek) Date: 2008-03-11 00:49
patch with more tests and explanations...

for the -r option, the standard call without the change would be:

$ python setup.py register -r pypi sdist upload -r pypi

which is very redundant. That's why config.py looks into args.

To avoid collisions, the right thing to do imho would be to have a
"shared_options" dict in the command classes to allow a given command
to get some options from another.

For instance, in the register command, in pseudo-code:

class register:
  shared_options = {'upload': ['repository']} 

and in the upload one:

class upload:
  shared_options = {'register': ['repository']} 

If register and upload are both present in the command line, then the
option is made available to both commands.

For instance, this two lines would provide the repository to the two
commands:

$ python setup.py register -r pypi sdist upload
$ python setup.py register sdist upload -r pypi (preferred way)

But this will be a patch proposition on its own.
msg63458 (view) Author: Tarek Ziadé (tarek) Date: 2008-03-11 01:39
making the contracted repository name work with verify_metadata and
list_classifiers
msg66562 (view) Author: A.M. Kuchling (akuchling) Date: 2008-05-10 18:54
Is the only purpose of the '-r' in sys.argv code to 
avoid having to specify arguments multiple times when you're doing 
multiple commands on a line?  Perhaps it would be acceptable to then 
just drop that bit of code completely; having to specify 'register -r 
pypi upload -r pypi' isn't the worst thing in the world, and it avoids 
worrying about oddball corner cases like 'setup.py newcommand -r 
something-different upload -r pypi'.

So, I'd suggest just taking that code out, and then committing the 
patch.
msg66564 (view) Author: Tarek Ziadé (tarek) Date: 2008-05-10 18:57
yes that was just for conveniency, so I guess it can be removed
msg66576 (view) Author: A.M. Kuchling (akuchling) Date: 2008-05-10 19:55
Committed to trunk as r62998; thank you very much for the patch!
msg66631 (view) Author: A.M. Kuchling (akuchling) Date: 2008-05-11 14:01
Brett backed out my commit in r63002 because I forgot to include the
distutils.config module.  Re-committed in r63014 and r63060.
History
Date User Action Args
2008-05-11 14:01:31akuchlingsetmessages: + msg66631
2008-05-10 19:55:06akuchlingsetstatus: open -> closed
keywords: - easy
resolution: accepted
messages: + msg66576
2008-05-10 18:57:34tareksetmessages: + msg66564
2008-05-10 18:54:20akuchlingsetmessages: + msg66562
2008-05-10 17:50:04akuchlingsetassignee: akuchling
2008-03-22 15:00:20tareksetfiles: - distutils.2008.03.11.patch
2008-03-22 15:00:15tareksetfiles: - distutils.2008.03.11.patch
2008-03-22 15:00:12tareksetfiles: - distutils.2008-03-05.patch
2008-03-22 15:00:09tareksetfiles: - bugday.distutils.patch
2008-03-22 15:00:05tareksetfiles: - bugday-distutils.patch
2008-03-22 15:00:02tareksetfiles: - distutils.patch
2008-03-20 00:30:36jafolinkissue1741 superseder
2008-03-20 00:28:49jafolinkissue2166 superseder
2008-03-12 20:02:00tareksetfiles: + distutils.2008.03.12.patch
2008-03-11 01:39:58tareksetfiles: + distutils.2008.03.11.patch
messages: + msg63458
2008-03-11 00:49:47tareksetfiles: + distutils.2008.03.11.patch
messages: + msg63457
2008-03-05 21:54:19tareksetfiles: + distutils.2008-03-05.patch
messages: + msg63296
2008-02-24 22:15:57tareksetmessages: + msg62948
2008-02-23 23:19:40akuchlingsetmessages: + msg62839
2008-02-23 23:15:23akuchlingsetnosy: + akuchling
messages: + msg62838
2008-02-23 16:00:05tareksetfiles: + bugday.distutils.patch
2008-02-23 15:59:34tareksetmessages: + msg62759
2008-02-23 15:36:43tareksetfiles: + bugday-distutils.patch
messages: + msg62752
2008-02-23 13:23:16facundobatistasetfiles: - patch.diff
2008-02-22 14:47:29tareksetmessages: + msg62687
2008-02-22 14:46:43tareksetfiles: + distutils.patch
2008-01-17 20:48:09christian.heimessetversions: + Python 3.0, - Python 2.5, Python 2.4
nosy: + christian.heimes
messages: + msg60058
priority: normal
keywords: + patch, easy
type: feature request
2008-01-17 12:32:53tarekcreate