ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: devel@lists.altlinux.org
Subject: [devel] call for python hackers (python utf-8)
Date: Fri, 2 Nov 2007 02:01:39 +0300
Message-ID: <20071101230139.GU19325@solemn.turbinal> (raw)
In-Reply-To: <20071101212010.GT19325@solemn.turbinal>

[-- Attachment #1: Type: text/plain, Size: 3535 bytes --]

On Fri, Nov 02, 2007 at 12:20:10AM +0300, Alexey Tourbin wrote:
> Похоже, я слишком сильно ослабил питоновские зависимости
> у python-module-libxml2.  В связи с этим ничего пока делать не нужно.
> Я, наверное, верну зависимость на python-modules-encodings назад,
> и, наверное, малость перетряхну сам питон.

Нет, не буду добавлять зависимость на python-modules-encodings
в python-module-libxml2.  Она там не нужна.  Реальная семантическая
зависимость на encodings находится в /usr/bin/xml2po. Питон тоже
перетряхивать не буду, он просто очень плохо распилен, взаимные
зависимости между базовыми подпакетами довольно сильные и никакой логики
в них нет.  Мне лишь кое-как удалось "выцепить" python-base, всё
остальное там практически каша какая-то с зависимостями.  Надо просто
заново обдумывать как распилить питон.

$ hsh-install python-modules-encodings
Preparing packages for installation...
ca-certificates-2007.02.06-alt1
libssl6-0.9.8d-alt4
libgdbm-1.8.3-alt4
python-modules-email-2.4.4-alt13
python-modules-compiler-2.4.4-alt13
python-modules-logging-2.4.4-alt13
python-modules-2.4.4-alt13
python-modules-encodings-2.4.4-alt13
$

Какая логика в таком распиле питона?
Никакой логики тут нет.

Думаю что попробую захачить rpm-build-python, чтобы при вызове метода
.encode() автоматически выставлялась зависимость на python2.4(encodings).
Правда, для меня это очень сложно, как там по этому AST ходить
взад-вперёд я слабовато представляю.  Однако инициатива наказуема.
Если кто-то шарит в питоне и может помочь написать мне соответствующий
код это будет здорово.  Остальным по-прежнему предлагаю ничего не делать.

/usr/lib/rpm/python.req.py:
    71	        for node in tree :
    72	            if type(node) in [types.ListType, types.TupleType] :
    73	                if node[0] == symbol.import_stmt :
    74	                    line = 0
    75	                    deps = []
    76	                    node = pro(node)
    77	                    if node[1][1] == 'import' :
    78	                        line = node[1][2]
    79	                        for name in namelist(node) :
    80	                            if IS_HIER is None :
    81	                                deps.append(name[1][1][1])
    82	                            else :
    83	                                deps.append(".".join( [ i for t,i in  name[1][1:] if t==1 ]))
    84	                    elif node[1][1] == 'from' :
    85	                        line = node[1][2]
    86	                        if IS_HIER is None :
    87	                            deps.append(node[2][1][1])
    88	                        else :
    89	                            deps.append(".".join( [ i for t,i in  node[2][1:] if t==1 ]))
    90	
    91	                    if REQ not in ['slight','relaxed'] or deep == 4 :
    92	                        for dep in deps :
    93	                            yield dep
    94	                    else :
    95	                        for dep in deps:
    96	                            print >> sys.stderr, "%s: %s: line=%d IGNORE module=%s" % (sys.argv[0], src, line, dep)
    !!
    !!			elif node[0] == symbol.power : # power -- это вроде вызов метода
    !!			    if ... # имеется что-то типа .encode(...)
    !!				yield "encodings"
    97	
    98	                for item in match(node,deep) :
    99	                    yield item

Также интересны другие случаи, кроме string.encode(), которые должны
давать зависимость на encodings.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2007-11-01 23:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 21:20 ` [devel] python utf-8 (I: Sisyphus-20071101 i586 beehive_status) Alexey Tourbin
2007-11-01 23:01   ` Alexey Tourbin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071101230139.GU19325@solemn.turbinal \
    --to=at@altlinux.ru \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git