Commits

Yosuke Ikeda committed 82c359a

P189 最初のパッケージを作る途中まで

  • Participants
  • Parent commits cb1fe30

Comments (0)

Files changed (13)

Atomisator/packages/atomisator.parser/README.txt

+Explain here what the package does.
+
+    >>> 1 + 1
+    2

Atomisator/packages/atomisator.parser/atomisator.parser.egg-info/PKG-INFO

+Metadata-Version: 1.0
+Name: atomisator.parser
+Version: 0.1.0
+Summary: UNKNOWN
+Home-page: UNKNOWN
+Author: UNKNOWN
+Author-email: UNKNOWN
+License: GPL
+Description: Explain here what the package does.
+        
+            >>> 1 + 1
+            2
+        
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: Topic :: Software Development :: Libraries :: Python Modules

Atomisator/packages/atomisator.parser/atomisator.parser.egg-info/SOURCES.txt

+README.txt
+setup.py
+atomisator/__init__.py
+atomisator.parser.egg-info/PKG-INFO
+atomisator.parser.egg-info/SOURCES.txt
+atomisator.parser.egg-info/dependency_links.txt
+atomisator.parser.egg-info/entry_points.txt
+atomisator.parser.egg-info/namespace_packages.txt
+atomisator.parser.egg-info/requires.txt
+atomisator.parser.egg-info/top_level.txt
+atomisator/parser/__init__.py

Atomisator/packages/atomisator.parser/atomisator.parser.egg-info/dependency_links.txt

+

Atomisator/packages/atomisator.parser/atomisator.parser.egg-info/entry_points.txt

+
+      # -*- Entry points: -*-
+      

Atomisator/packages/atomisator.parser/atomisator.parser.egg-info/namespace_packages.txt

+atomisator

Atomisator/packages/atomisator.parser/atomisator.parser.egg-info/requires.txt

+setuptools

Atomisator/packages/atomisator.parser/atomisator.parser.egg-info/top_level.txt

+atomisator

Atomisator/packages/atomisator.parser/atomisator/__init__.py

+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)
+

Atomisator/packages/atomisator.parser/atomisator/parser/__init__.py

+#

Atomisator/packages/atomisator.parser/setup.py

+from setuptools import setup, find_packages
+import os
+
+version = '0.1.0'
+long_description = open('README.txt').read()
+classifiers = [
+    'Programming Language :: Python',
+    'Topic :: Software Development :: Libraries :: Python Modules',
+    ]
+
+setup(name='atomisator.parser',
+      version=version,
+      description='',
+      long_description=long_description,
+      classifiers=classifiers,
+      keywords='',
+      author='',
+      author_email='',
+      url='',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['atomisator'],
+      include_package_data=True,
+      install_requires=[
+          'setuptools',
+	  # -*- Extra requirements: -*-
+      ],
+      test_suite='nose.collector',
+      tests_require=['Nose'],
+      entry_points="""
+      # -*- Entry points: -*-
+      """,
+      )
 3. テスト環境の構築
 4. doctest をパスするコードを書く
 
+
+最初のパッケージを作る
+======================
+
+- pbp_package テンプレートを使って新規パッケージを作成::
+
+    $ cd Atomisator/packages
+    $ paster create -t pbp_package atomisator.parser
+
+- develop コマンド呼び出し::
+
+    $ cd atomisator.parser
+    $ python setup.py develop
+
+- README.txt の doctest を実行
+
+    $ nosetests --with-doctest --doctest-extensions=.txt
+
+- setup.py の test コマンドでもテスト実行できるが、nosetests スクリプトの方が
+
+  - 簡単にオプションを指定できる
+  - 複数パッケージにまたがったテストを実行できる
+
+- ~/.noserc があると doctest-extensions オプションは無視される -> 詳細は 11 章
+
+

pip-requirement.txt

+nose==1.0.0
+PasteScript==1.7.3
+Cheetah==2.4.4