Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
acf71b89
Kaydet (Commit)
acf71b89
authored
Haz 02, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Merge packaging doc fix
üst
721ccd0c
55729fe7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
103 additions
and
31 deletions
+103
-31
index.rst
Doc/distutils/index.rst
+4
-6
index.rst
Doc/install/index.rst
+56
-0
distutils.rst
Doc/library/distutils.rst
+9
-6
index.rst
Doc/packaging/index.rst
+1
-1
indexcontent.html
Doc/tools/sphinxext/indexcontent.html
+2
-2
check.py
Lib/packaging/command/check.py
+1
-1
support.py
Lib/packaging/tests/support.py
+13
-7
test_command_check.py
Lib/packaging/tests/test_command_check.py
+17
-5
test_manifest.py
Lib/packaging/tests/test_manifest.py
+0
-3
No files found.
Doc/distutils/index.rst
Dosyayı görüntüle @
acf71b89
...
@@ -14,6 +14,10 @@ the module developer's point of view, describing how to use the Distutils to
...
@@ -14,6 +14,10 @@ the module developer's point of view, describing how to use the Distutils to
make Python modules and extensions easily available to a wider audience with
make Python modules and extensions easily available to a wider audience with
very little overhead for build/release/install mechanics.
very little overhead for build/release/install mechanics.
.. deprecated:: 3.3
:mod:`packaging` replaces Distutils. See :ref:`packaging-index` and
:ref:`packaging-install-index`.
.. toctree::
.. toctree::
:maxdepth: 2
:maxdepth: 2
:numbered:
:numbered:
...
@@ -36,9 +40,3 @@ following the above guidelines:
...
@@ -36,9 +40,3 @@ following the above guidelines:
.. toctree::
.. toctree::
install.rst
install.rst
.. seealso::
:ref:`packaging-index` and :ref:`packaging-install-index`
Documentation of Packaging, the new version of Distutils.
Doc/install/index.rst
0 → 100644
Dosyayı görüntüle @
acf71b89
.. _packaging-install-index:
******************************
Installing Python Projects
******************************
:Author: The Fellowship of the Packaging
:Release: |version|
:Date: |today|
.. TODO: Fill in XXX comments
.. The audience for this document includes people who don't know anything
about Python and aren't about to learn the language just in order to
install and maintain it for their users, i.e. system administrators.
Thus, I have to be sure to explain the basics at some point:
sys.path and PYTHONPATH at least. Should probably give pointers to
other docs on "import site", PYTHONSTARTUP, PYTHONHOME, etc.
Finally, it might be useful to include all the material from my "Care
and Feeding of a Python Installation" talk in here somewhere. Yow!
.. topic:: Abstract
This document describes Packaging from the end-user's point of view: it
explains how to extend the functionality of a standard Python installation by
building and installing third-party Python modules and applications.
This guide is split into a simple overview followed by a longer presentation of
the :program:`pysetup` script, the Python package management tool used to
build, distribute, search for, install, remove and list Python distributions.
.. TODO integrate install and pysetup instead of duplicating
.. toctree::
:maxdepth: 2
:numbered:
install
pysetup
pysetup-config
pysetup-servers
.. seealso::
:ref:`packaging-index`
The manual for developers of Python projects who want to package and
distribute them. This describes how to use :mod:`packaging` to make
projects easily found and added to an existing Python installation.
:mod:`packaging`
A library reference for developers of packaging tools wanting to use
standalone building blocks like :mod:`~packaging.version` or
:mod:`~packaging.metadata`, or extend Packaging itself.
Doc/library/distutils.rst
Dosyayı görüntüle @
acf71b89
...
@@ -12,21 +12,24 @@ additional modules into a Python installation. The new modules may be either
...
@@ -12,21 +12,24 @@ additional modules into a Python installation. The new modules may be either
100%-pure Python, or may be extension modules written in C, or may be
100%-pure Python, or may be extension modules written in C, or may be
collections of Python packages which include modules coded in both Python and C.
collections of Python packages which include modules coded in both Python and C.
This package is discussed in two separate chapters:
.. deprecated:: 3.3
:mod:`packaging` replaces Distutils. See :ref:`packaging-index` and
:ref:`packaging-install-index`.
User documentation and API reference are provided in another document:
.. seealso::
.. seealso::
:ref:`distutils-index`
:ref:`distutils-index`
The manual for developers and packagers of Python modules. This describes
The manual for developers and packagers of Python modules. This describes
how to prepare :mod:`distutils`\ -based packages so that they may be
how to prepare :mod:`distutils`\ -based packages so that they may be
easily installed into an existing Python installation.
easily installed into an existing Python installation. If also contains
instructions for end-users wanting to install a distutils-based package,
:ref:`install-index`.
:ref:`install-index`
An "administrators" manual which includes information on installing
modules into an existing Python installation. You do not need to be a
Python programmer to read this manual.
.. trick to silence a Sphinx warning
.. toctree::
.. toctree::
:hidden:
:hidden:
...
...
Doc/packaging/index.rst
Dosyayı görüntüle @
acf71b89
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
Distributing Python Projects
Distributing Python Projects
##############################
##############################
:Authors: The Fellowship of
T
he Packaging
:Authors: The Fellowship of
t
he Packaging
:Email: distutils-sig@python.org
:Email: distutils-sig@python.org
:Release: |version|
:Release: |version|
:Date: |today|
:Date: |today|
...
...
Doc/tools/sphinxext/indexcontent.html
Dosyayı görüntüle @
acf71b89
...
@@ -21,9 +21,9 @@
...
@@ -21,9 +21,9 @@
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
c-api
/
index
")
}}"
>
Python/C API
</a><br/>
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
c-api
/
index
")
}}"
>
Python/C API
</a><br/>
<span
class=
"linkdescr"
>
reference for C/C++ programmers
</span></p>
<span
class=
"linkdescr"
>
reference for C/C++ programmers
</span></p>
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
install
/
index
")
}}"
>
Installing Python Projects
</a><br/>
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
install
/
index
")
}}"
>
Installing Python Projects
</a><br/>
<span
class=
"linkdescr"
>
information for installers
&
sys-admi
ns
</span></p>
<span
class=
"linkdescr"
>
finding and installing modules and applicatio
ns
</span></p>
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
packaging
/
index
")
}}"
>
Distributing Python Projects
</a><br/>
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
packaging
/
index
")
}}"
>
Distributing Python Projects
</a><br/>
<span
class=
"linkdescr"
>
sharing modules with other
s
</span></p>
<span
class=
"linkdescr"
>
packaging and distributing modules and application
s
</span></p>
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
documenting
/
index
")
}}"
>
Documenting Python
</a><br/>
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
documenting
/
index
")
}}"
>
Documenting Python
</a><br/>
<span
class=
"linkdescr"
>
guide for documentation authors
</span></p>
<span
class=
"linkdescr"
>
guide for documentation authors
</span></p>
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
faq
/
index
")
}}"
>
FAQs
</a><br/>
<p
class=
"biglink"
><a
class=
"biglink"
href=
"{{ pathto("
faq
/
index
")
}}"
>
FAQs
</a><br/>
...
...
Lib/packaging/command/check.py
Dosyayı görüntüle @
acf71b89
...
@@ -32,7 +32,7 @@ class check(Command):
...
@@ -32,7 +32,7 @@ class check(Command):
# XXX we could use a special handler for this, but would need to test
# XXX we could use a special handler for this, but would need to test
# if it works even if the logger has a too high level
# if it works even if the logger has a too high level
self
.
_warnings
.
append
((
msg
,
args
))
self
.
_warnings
.
append
((
msg
,
args
))
return
logger
.
warning
(
self
.
get_command_name
()
+
msg
,
*
args
)
return
logger
.
warning
(
'
%
s:
%
s'
%
(
self
.
get_command_name
(),
msg
)
,
*
args
)
def
run
(
self
):
def
run
(
self
):
"""Runs the command."""
"""Runs the command."""
...
...
Lib/packaging/tests/support.py
Dosyayı görüntüle @
acf71b89
...
@@ -90,17 +90,23 @@ class LoggingCatcher:
...
@@ -90,17 +90,23 @@ class LoggingCatcher:
def
get_logs
(
self
,
*
levels
):
def
get_logs
(
self
,
*
levels
):
"""Return all log messages with level in *levels*.
"""Return all log messages with level in *levels*.
Without explicit levels given, returns all messages.
Without explicit levels given, returns all messages. *levels* defaults
*levels* defaults to all levels. For log calls with arguments (i.e.
to all levels. For log calls with arguments (i.e.
logger.info('bla bla
%
s', arg)), the messages
logger.info('bla bla
%
r', arg)), the messages will be formatted before
Returns a list.
being returned (e.g. "bla bla 'thing'").
Returns a list. Automatically flushes the loghandler after being
called.
Example: self.get_logs(logging.WARN, logging.DEBUG).
Example: self.get_logs(logging.WARN, logging.DEBUG).
"""
"""
if
not
levels
:
if
not
levels
:
return
[
log
.
getMessage
()
for
log
in
self
.
loghandler
.
buffer
]
messages
=
[
log
.
getMessage
()
for
log
in
self
.
loghandler
.
buffer
]
return
[
log
.
getMessage
()
for
log
in
self
.
loghandler
.
buffer
else
:
if
log
.
levelno
in
levels
]
messages
=
[
log
.
getMessage
()
for
log
in
self
.
loghandler
.
buffer
if
log
.
levelno
in
levels
]
self
.
loghandler
.
flush
()
return
messages
class
TempdirManager
:
class
TempdirManager
:
...
...
Lib/packaging/tests/test_command_check.py
Dosyayı görüntüle @
acf71b89
...
@@ -36,7 +36,6 @@ class CheckTestCase(support.LoggingCatcher,
...
@@ -36,7 +36,6 @@ class CheckTestCase(support.LoggingCatcher,
# now let's add the required fields
# now let's add the required fields
# and run it again, to make sure we don't get
# and run it again, to make sure we don't get
# any warning anymore
# any warning anymore
self
.
loghandler
.
flush
()
metadata
=
{
'home_page'
:
'xxx'
,
'author'
:
'xxx'
,
metadata
=
{
'home_page'
:
'xxx'
,
'author'
:
'xxx'
,
'author_email'
:
'xxx'
,
'author_email'
:
'xxx'
,
'name'
:
'xxx'
,
'version'
:
'4.2'
,
'name'
:
'xxx'
,
'version'
:
'4.2'
,
...
@@ -50,8 +49,10 @@ class CheckTestCase(support.LoggingCatcher,
...
@@ -50,8 +49,10 @@ class CheckTestCase(support.LoggingCatcher,
self
.
assertRaises
(
PackagingSetupError
,
self
.
_run
,
self
.
assertRaises
(
PackagingSetupError
,
self
.
_run
,
{
'name'
:
'xxx'
,
'version'
:
'xxx'
},
**
{
'strict'
:
1
})
{
'name'
:
'xxx'
,
'version'
:
'xxx'
},
**
{
'strict'
:
1
})
#
and of course, no error when all metadata fields are present
#
clear warnings from the previous calls
self
.
loghandler
.
flush
()
self
.
loghandler
.
flush
()
# and of course, no error when all metadata fields are present
cmd
=
self
.
_run
(
metadata
,
strict
=
True
)
cmd
=
self
.
_run
(
metadata
,
strict
=
True
)
self
.
assertEqual
([],
self
.
get_logs
(
logging
.
WARNING
))
self
.
assertEqual
([],
self
.
get_logs
(
logging
.
WARNING
))
...
@@ -70,7 +71,6 @@ class CheckTestCase(support.LoggingCatcher,
...
@@ -70,7 +71,6 @@ class CheckTestCase(support.LoggingCatcher,
'name'
:
'xxx'
,
'version'
:
'4.2'
,
'name'
:
'xxx'
,
'version'
:
'4.2'
,
'requires_python'
:
'2.4'
,
'requires_python'
:
'2.4'
,
}
}
self
.
loghandler
.
flush
()
cmd
=
self
.
_run
(
metadata
)
cmd
=
self
.
_run
(
metadata
)
self
.
assertEqual
([],
self
.
get_logs
(
logging
.
WARNING
))
self
.
assertEqual
([],
self
.
get_logs
(
logging
.
WARNING
))
...
@@ -85,9 +85,11 @@ class CheckTestCase(support.LoggingCatcher,
...
@@ -85,9 +85,11 @@ class CheckTestCase(support.LoggingCatcher,
self
.
assertRaises
(
PackagingSetupError
,
self
.
_run
,
metadata
,
self
.
assertRaises
(
PackagingSetupError
,
self
.
_run
,
metadata
,
**
{
'strict'
:
1
})
**
{
'strict'
:
1
})
# clear warnings from the previous calls
self
.
loghandler
.
flush
()
# now with correct version format again
# now with correct version format again
metadata
[
'version'
]
=
'4.2'
metadata
[
'version'
]
=
'4.2'
self
.
loghandler
.
flush
()
cmd
=
self
.
_run
(
metadata
,
strict
=
True
)
cmd
=
self
.
_run
(
metadata
,
strict
=
True
)
self
.
assertEqual
([],
self
.
get_logs
(
logging
.
WARNING
))
self
.
assertEqual
([],
self
.
get_logs
(
logging
.
WARNING
))
...
@@ -100,7 +102,6 @@ class CheckTestCase(support.LoggingCatcher,
...
@@ -100,7 +102,6 @@ class CheckTestCase(support.LoggingCatcher,
cmd
.
check_restructuredtext
()
cmd
.
check_restructuredtext
()
self
.
assertEqual
(
len
(
self
.
get_logs
(
logging
.
WARNING
)),
1
)
self
.
assertEqual
(
len
(
self
.
get_logs
(
logging
.
WARNING
)),
1
)
self
.
loghandler
.
flush
()
pkg_info
,
dist
=
self
.
create_dist
(
description
=
'title
\n
=====
\n\n
test'
)
pkg_info
,
dist
=
self
.
create_dist
(
description
=
'title
\n
=====
\n\n
test'
)
cmd
=
check
(
dist
)
cmd
=
check
(
dist
)
cmd
.
check_restructuredtext
()
cmd
.
check_restructuredtext
()
...
@@ -123,6 +124,17 @@ class CheckTestCase(support.LoggingCatcher,
...
@@ -123,6 +124,17 @@ class CheckTestCase(support.LoggingCatcher,
cmd
.
check_hooks_resolvable
()
cmd
.
check_hooks_resolvable
()
self
.
assertEqual
(
len
(
self
.
get_logs
(
logging
.
WARNING
)),
1
)
self
.
assertEqual
(
len
(
self
.
get_logs
(
logging
.
WARNING
)),
1
)
def
test_warn
(
self
):
_
,
dist
=
self
.
create_dist
()
cmd
=
check
(
dist
)
self
.
assertEqual
([],
self
.
get_logs
())
cmd
.
warn
(
'hello'
)
self
.
assertEqual
([
'check: hello'
],
self
.
get_logs
())
cmd
.
warn
(
'hello
%
s'
,
'world'
)
self
.
assertEqual
([
'check: hello world'
],
self
.
get_logs
())
cmd
.
warn
(
'hello
%
s
%
s'
,
'beautiful'
,
'world'
)
self
.
assertEqual
([
'check: hello beautiful world'
],
self
.
get_logs
())
def
test_suite
():
def
test_suite
():
return
unittest
.
makeSuite
(
CheckTestCase
)
return
unittest
.
makeSuite
(
CheckTestCase
)
...
...
Lib/packaging/tests/test_manifest.py
Dosyayı görüntüle @
acf71b89
...
@@ -50,9 +50,6 @@ class ManifestTestCase(support.TempdirManager,
...
@@ -50,9 +50,6 @@ class ManifestTestCase(support.TempdirManager,
for
warning
in
warnings
:
for
warning
in
warnings
:
self
.
assertIn
(
'no files found matching'
,
warning
)
self
.
assertIn
(
'no files found matching'
,
warning
)
# reset logs for the next assert
self
.
loghandler
.
flush
()
# manifest also accepts file-like objects
# manifest also accepts file-like objects
with
open
(
MANIFEST
)
as
f
:
with
open
(
MANIFEST
)
as
f
:
manifest
.
read_template
(
f
)
manifest
.
read_template
(
f
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment