zopefoundation / zope.i18nmessageid Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Because the import line simply does import _zope_i8nmessageid_message
, which is absolute, and so the module con't be found.
Checklist from zopefoundation/zope.proxy#24
Seen running the zope.app.apidoc tests, but probably also shows up with zope.app.preference. The same tests pass with 4.2 and under CPython:
File "//pypy/site-packages/zope/app/apidoc/browser/preference.py", line 40, in __init__
super(ApidocEditPreferenceGroup, self).__init__(context, request)
File "//pypy/site-packages/zope/app/preference/browser.py", line 84, in __init__
self.label = Message(pref_msg, mapping={u'name': name})
File "//pypy/site-packages/zope/i18nmessageid/message.py", line 41, in __new__
default = ustr.default[:] if default is _marker else default
TypeError: 'NoneType' object is not subscriptable
Currently, the C extension is unconditionally imported:
zope.i18nmessageid/src/zope/i18nmessageid/message.py
Lines 97 to 100 in 1d6cc94
This makes it difficult to test the Python implementation on CPython; you have to remove the dynamic library.
Most Zope projects that have a C extension respect a PURE_PYTHON=1
environment variable to disable importing the C extension. This project should as well.
(See #27 (comment))
The C implementation will happily keep and return whatever object you provide for default
. But Python forces it to be unicode by calling unicode(default).
If the default
is not unicode already, this can cause issues. Some of them are noisy (a UnicodeDecodeError on Python 2) but on Python 3, especially, it's possible to get things like "b'abc'"
because unicode
is just str
.
It seems to me that the Python implementation should not force the default to be unicode (easiest). Alternatively, they should both force it to unicode.
This came up in zopefoundation/zope.app.locales#4, because there is a test case that explicitly wants to use bytes for the default ("default might be a string with the DEFAULT_ENCODING---8bit").
The newest 5.1.0 release of zope.i18nmessageid lacks the sdist tarball and features only Windows wheels. This makes it impossible to install it via pip
on any other platform, i.e.:
$ pip install zope.i18nmessageid==5.1.0
ERROR: Could not find a version that satisfies the requirement zope.i18nmessageid==5.1.0 (from versions: 3.4dev-r73161, 3.4.0, 3.4.2, 3.4.3, 3.5.0, 3.5.1, 3.5.2, 3.5.3, 3.6.0, 3.6.1, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.1.0, 4.2, 4.3, 4.3.1, 5.0.0, 5.0.1)
ERROR: No matching distribution found for zope.i18nmessageid==5.1.0
See https://zopei18nmessageid.readthedocs.io/en/latest/hacking.html where it still talks about bzr
and other outdated things.
The py3x-pure
tests don't fail due to #28, but this bug causes the pypy3
doctests to fail on master:
$ tox -re pypy3
...
pypy3: commands[1]> sphinx-build -b doctest -d /home/tseaver/projects/Zope/Z3/zope.i18nmessageid/.tox/pypy3/.cache/doctrees docs /home/tseaver/projects/Zope/Z3/zope.i18nmessageid/.tox/pypy3/.cache/doctest
...
running tests...
Document: narr
--------------
**********************************************************************
File "narr.rst", line 96, in default
Failed example:
robot.domain = "planetexpress"
Expected:
Traceback (most recent call last):
...
AttributeError: readonly attribute
Got:
Traceback (most recent call last):
File "/opt/pypy3.10-v7.3.16-linux64/lib/pypy3.10/doctest.py", line 1352, in __run
exec(compile(example.source, filename, "single",
File "<doctest default[0]>", line 1, in <module>
robot.domain = "planetexpress"
File "/home/tseaver/projects/Zope/Z3/zope.i18nmessageid/src/zope/i18nmessageid/message.py", line 79, in __setattr__
raise TypeError('readonly attribute')
TypeError: readonly attribute
**********************************************************************
File "narr.rst", line 101, in default
Failed example:
robot.default = u"${name} is not a robot."
Expected:
Traceback (most recent call last):
...
AttributeError: readonly attribute
Got:
Traceback (most recent call last):
File "/opt/pypy3.10-v7.3.16-linux64/lib/pypy3.10/doctest.py", line 1352, in __run
exec(compile(example.source, filename, "single",
File "<doctest default[1]>", line 1, in <module>
robot.default = u"${name} is not a robot."
File "/home/tseaver/projects/Zope/Z3/zope.i18nmessageid/src/zope/i18nmessageid/message.py", line 79, in __setattr__
raise TypeError('readonly attribute')
TypeError: readonly attribute
**********************************************************************
File "narr.rst", line 106, in default
Failed example:
robot.mapping = {'name': 'Bender'}
Expected:
Traceback (most recent call last):
...
AttributeError: readonly attribute
Got:
Traceback (most recent call last):
File "/opt/pypy3.10-v7.3.16-linux64/lib/pypy3.10/doctest.py", line 1352, in __run
exec(compile(example.source, filename, "single",
File "<doctest default[2]>", line 1, in <module>
robot.mapping = {'name': 'Bender'}
File "/home/tseaver/projects/Zope/Z3/zope.i18nmessageid/src/zope/i18nmessageid/message.py", line 79, in __setattr__
raise TypeError('readonly attribute')
TypeError: readonly attribute
**********************************************************************
1 items had failures:
3 of 35 in default
35 tests in 1 items.
32 passed and 3 failed.
***Test Failed*** 3 failures.
Doctest summary
===============
35 tests
3 failures in tests
0 failures in setup code
0 failures in cleanup code
build finished with problems, 1 warning.
pypy3: exit 1 (2.17 seconds) /home/tseaver/projects/Zope/Z3/zope.i18nmessageid> sphinx-build -b doctest -d /home/tseaver/projects/Zope/Z3/zope.i18nmessageid/.tox/pypy3/.cache/doctrees docs /home/tseaver/projects/Zope/Z3/zope.i18nmessageid/.tox/pypy3/.cache/doctest pid=94066
pypy3: FAIL โ in 7.6 seconds
It would be great to tests running and wheels released for all recent Python versions such as 3.9+3.10.
$ tox -e docs
...
docs: commands[0]> sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
Running Sphinx v7.3.7
WARNING: The pre-Sphinx 1.0 'intersphinx_mapping' format is deprecated and will be removed in Sphinx 8. Update to the current format as described in the documentation. Hint: "intersphinx_mapping = {'<name>': ('http://docs.python.org/', None)}".https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html#confval-intersphinx_mapping
---
On building my packages I'm using sphinx-build
command with -n
switch which shows warmings about missing references. These are not critical issues.
Here is the output with warnings:
+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v4.5.0
making output directory... done
loading intersphinx inventory from http://docs.python.org/objects.inv...
intersphinx inventory has moved: http://docs.python.org/objects.inv -> https://docs.python.org/3/objects.inv
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 4 added, 0 changed, 0 removed
reading sources... [100%] narr
WARNING: autodoc: failed to import module 'i18nmessageid.message' from module 'zope'; the following exception was raised:
No module named 'zope.i18nmessageid'
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-zope-i18nmessageid.3 { narr api hacking } /home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/index.rst:1: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/narr.rst:1: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/narr.rst:24: WARNING: py:class reference target not found: zope.i18nmessageid.message.Message
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/narr.rst:35: WARNING: py:class reference target not found: zope.i18nmessageid.message.MessageFactory
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/api.rst:1: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/api.rst:4: WARNING: py:mod reference target not found: zope.i18nmessageid.message
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:1: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:8: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:75: WARNING: py:mod reference target not found: nose
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:75: WARNING: py:mod reference target not found: coverage
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:89: WARNING: py:mod reference target not found: coverage
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:112: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:112: WARNING: py:mod reference target not found: Sphinx
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:150: WARNING: py:mod reference target not found: zc.buildout
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:156: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:186: WARNING: py:mod reference target not found: tox
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:199: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:199: WARNING: py:mod reference target not found: tox
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:202: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:207: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:207: WARNING: py:mod reference target not found: nose
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:207: WARNING: py:mod reference target not found: coverage
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:212: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:262: WARNING: py:mod reference target not found: zope.i18nmessageid
/home/tkloczko/rpmbuild/BUILD/zope.i18nmessageid-5.0.1/docs/hacking.rst:268: WARNING: py:mod reference target not found: zope.i18nmessageid
done
build succeeded, 26 warnings.
You can peak on fixes that kind of issues in other projects
latchset/jwcrypto#289
click-contrib/sphinx-click@abc31069
On aarch64, 'pip install zope-i18nmessageid' builds the wheels from source code and then install it. It requires the user to have development environment installed on his system. Also, it take some time to build the wheels than downloading and extracting the wheels from PyPi.
On aarch64, pip install zope-i18nmessageid' should download the wheels from PyPi
@mgedmin, Please let me know your interest on releasing aarch64 wheels. I can help in this.
When we subtract reference counter of an object, the destructor is automatically called if the value of counter is 0.
At the same time an error occurs, as the GC executed while the destructor is still in running phase.
To eliminate the error, we have added below program which exclude objects from GC in the destructor in line 4.
static void
Wrapper_dealloc(Wrapper *self)
{
PyObject_GC_UnTrack((PyObject )self); //Add this line to eliminate self from GC
Wrapper_clear(self);
self->ob_type->tp_free((PyObject)self);
}
Patch: zope.i18nmessageid.zip
Documentation link in README renders 404.
Similar to zopefoundation/zope.interface#184. This breaks, for example, PyPy3 builds: https://travis-ci.org/zopefoundation/zope.container/jobs/660521875#L268
Collecting zope.i18nmessageid
Downloading zope.i18nmessageid-5.0.0.tar.gz (28 kB)
ERROR: Command errored out with exit status 1:
command: /home/travis/virtualenv/pypy3.6-7.1.1/bin/pypy3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-rd8qof6w/zope.i18nmessageid/setup.py'"'"'; __file__='"'"'/tmp/pip-install-rd8qof6w/zope.i18nmessageid/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-rd8qof6w/zope.i18nmessageid/pip-egg-info
cwd: /tmp/pip-install-rd8qof6w/zope.i18nmessageid/
Complete output (5 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-rd8qof6w/zope.i18nmessageid/setup.py", line 25, in <module>
from setuptools import setup, find_packages, Extension, Feature
ImportError: cannot import name 'Feature'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I think we just need to publish a new release, code in master has removed this.
grep -R six
;-)
Ideally, no dependency on six
, or at least code using six
.
It seems that six
is a declared as a dependency but it's not used anywhere in the code.
Gentoo Linux, Python 3.11.2, zope-i18nmessageid 6.0.0
In https://bugs.launchpad.net/zope.i18nmessageid/+bug/235469, Christian Zagrodnick reported:
Currently one can do the following:
msgid = _(u'foo', mapping = {})
msgid.mapping['bar'] = something
So in a way a non modifiable object will be modified. Shouldn't we prevent this?
On create github release entry is created email notification to those whom have set in your repo the web UI Watch->Releases.
gh release can contain additional comments (li changelog) or additional assets like release tar balls (by default it contains only assets from git tag) however all those part are not obligatory.
In simplest variant gh release can be empty because subiekt of the sent email contains git tag name.
I'm asking because my automation process uses those email notifications by trying to make preliminary automated upgrades of building packages, which allows saving some time on maintaining packaging procedures.
Probably other people may be interested to be instantly informed about release new version as well.
Documentation and examples of generate gh releases:
https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
https://cli.github.com/manual/gh_release_upload/
jbms/sphinx-immaterial#282
https://github.com/marketplace/actions/github-release
https://pgjones.dev/blog/trusted-plublishing-2023/
jbms/sphinx-immaterial#281 (comment)
tox target to publish on pypi and make gh release https://github.com/jaraco/skeleton/blob/928e9a86d61d3a660948bcba7689f90216cc8243/tox.ini#L42-L58
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.