zopefoundation / z3c.form

An advanced form and widget framework for Zope 3
Other
8 stars 39 forks source link

Tag 3.2.1 on pypi and on github are different #25

Closed bogdangi closed 6 years ago

bogdangi commented 9 years ago

Hi

Tag from pypi https://pypi.python.org/pypi/z3c.form/3.2.1 and from github https://github.com/zopefoundation/z3c.form/releases/tag/3.2.1 are different.

The tag on pypi does not contain "Remove spaces at start and end of text field values." feature but it is in Changes.

Should we update tag on pypi or just left it as it is?

Best regards, Bogdan.

mgedmin commented 9 years ago

The contents of the sdist on PyPI for a particular version should match the git tree with the same tag. This is not the case currently:

diff -u -r gittag/CHANGES.txt z3c.form-3.2.1/CHANGES.txt
--- gittag/CHANGES.txt  2014-06-09 16:11:16.000000000 +0300
+++ z3c.form-3.2.1/CHANGES.txt  2014-04-22 19:07:20.000000000 +0300
@@ -2,13 +2,11 @@
 CHANGES
 =======

-3.2.1 (2014-06-09)
+3.2.1 (2014-04-22)
 ------------------

 - Add DataExtractedEvent, which is thrown after data and errors are extracted
-  from widgets. Fixes https://github.com/zopefoundation/z3c.form/pull/18
-
-- Remove spaces at start and end of text field values.
+  from widgets. Fixes https://github.com/zopefoundation/z3c.form/pull/18 

 - Explicitly hide span in ``orderedselect_input.pt``.  This only
   contains hidden inputs, but Internet Explorer 10 was showing them
Only in z3c.form-3.2.1/: PKG-INFO
Only in z3c.form-3.2.1/: setup.cfg
diff -u -r gittag/src/z3c/form/converter.py z3c.form-3.2.1/src/z3c/form/converter.py
--- gittag/src/z3c/form/converter.py    2014-06-09 16:11:16.000000000 +0300
+++ z3c.form-3.2.1/src/z3c/form/converter.py    2014-04-22 19:07:20.000000000 +0300
@@ -31,8 +31,6 @@
 @zope.interface.implementer(interfaces.IDataConverter)
 class BaseDataConverter(object):
     """A base implementation of the data converter."""
-    
-    _strip_value = True # Remove spaces at start and end of text line

     def __init__(self, field, widget):
         self.field = field
@@ -46,8 +44,6 @@

     def toFieldValue(self, value):
         """See interfaces.IDataConverter"""
-        if self._strip_value and isinstance(value, basestring):
-            value = value.strip()
         if value == u'':
             return self.field.missing_value
         return self.field.fromUnicode(value)
diff -u -r gittag/src/z3c/form/converter.txt z3c.form-3.2.1/src/z3c/form/converter.txt
--- gittag/src/z3c/form/converter.txt   2014-06-09 16:11:16.000000000 +0300
+++ z3c.form-3.2.1/src/z3c/form/converter.txt   2014-04-22 19:07:20.000000000 +0300
@@ -241,19 +241,6 @@
       (u'The entered value is not a valid decimal literal.', u'fff')

-Text Data Converters
-----------------------
-
-Users often add empty spaces by mistake, for example when copy-pasting content
-into the form.
-
-  >>> name = zope.schema.TextLine()
-  >>> namewidget = widget.Widget(TestRequest())
-  >>> conv = converter.FieldDataConverter(name, namewidget)
-  >>> conv.toFieldValue(u'Einstein ')
-  'Einstein'
-
-
 Date Data Converter
 -------------------

Only in z3c.form-3.2.1/src/z3c/form/locales/cs/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/da/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/de/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/en/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/es/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/fr/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/hu/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/it/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/ja/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/no/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/pt_BR/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/ru/LC_MESSAGES: z3c.form.mo
Only in z3c.form-3.2.1/src/z3c/form/locales/zh_CN/LC_MESSAGES: z3c.form.mo
diff -u -r gittag/src/z3c/form/subform.txt z3c.form-3.2.1/src/z3c/form/subform.txt
--- gittag/src/z3c/form/subform.txt 2014-06-09 16:11:16.000000000 +0300
+++ z3c.form-3.2.1/src/z3c/form/subform.txt 2014-04-22 19:07:20.000000000 +0300
@@ -363,7 +363,7 @@
 the parent form, the sub-form is still submitted:

   >>> request = TestRequest(form={
-  ...     'car.widgets.model': u'Volvo\n~',
+  ...     'car.widgets.model': u'Volvo\n',
   ...     'car.widgets.make': u'450',
   ...     'car.buttons.apply': u'Apply',
   ...     'owner.widgets.name': u'Stephan Richter',
@@ -400,7 +400,7 @@
           <input type="text" id="car-widgets-model"
                  name="car.widgets.model"
                  class="text-widget required textline-field"
-                 value="Volvo ~" />
+                 value="Volvo " />
         </div>
         <div class="row">
           <label for="car-widgets-make">Make</label>
Only in z3c.form-3.2.1/src: z3c.form.egg-info

PyPI releases are immutable. Git tags are mutable. Therefore it would appear that we should fix the git tag.

agroszer commented 9 years ago

well the github tag was me

pypi entries:

new release 2014-04-22 17:07    esteele 138.199.71.86
add source file z3c.form-3.2.1.zip  2014-04-22 17:08    esteele 138.199.71.86
update description, classifiers 2014-06-09 13:11    agroszer    88.132.181.185
agroszer commented 9 years ago

https://github.com/zopefoundation/z3c.form/commit/f5dcfa1a6f80ea4b3fa666917595d288ec17169b

mgedmin commented 9 years ago

Looks like the PyPI upload lacks e68d771909d7366176a24b0d2f4cd4ba5912c917 so it probably matches c866db6023c590baf7ada249b049fc6900280985.

I regret not automating the comparison procedure. Manually checking out the commit, doing a git export to a tarball, then unpacking the tarball in a temp dir and doing a recursive diff with an unpacked pypi zip in a different temp dir is tedious!

mgedmin commented 9 years ago

Is 'esteele' on PyPI and @esteele on GitHub the same person? Perhaps they have the right release commit/tag lying around in their local clone still?