@@ -19,18 +19,17 @@ Execute the following commands to install the packages required for this tutoria
19
19
Prepare your package for distribution
20
20
-------------------------------------
21
21
22
- Annotate the version number of your package in ``VERSION `` and ``__init__.py ``
23
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
- Save the following to the ``VERSION `` file of your package, e.g. ``/path/to/intro_to_wc_modeling/intro_to_wc_modeling/VERSION ``::
22
+ Annotate the version number of your package in ``_version.py `` and ``__init__.py ``
23
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
+ Save the following to the ``_version.py `` file of your package, e.g. ``/path/to/intro_to_wc_modeling/intro_to_wc_modeling/_version.py ``::
25
25
26
- 0.0.1
26
+ __version__ = ' 0.0.1'y
27
27
28
28
Save the following to the ``__init__.py `` file of your package, e.g. ``/path/to/package/intro_to_wc_modeling/__init__.py ``::
29
29
30
30
import pkg_resources
31
31
32
- with open(pkg_resources.resource_filename('intro_to_wc_modeling', 'VERSION'), 'r') as file:
33
- __version__ = file.read().strip()
32
+ from ._version.py import __version__
34
33
# :obj:`str`: version
35
34
36
35
@@ -127,9 +126,6 @@ For example, save the following to ``/path/to/package/MANIFEST.in``::
127
126
# documentation
128
127
include README.rst
129
128
130
- # version
131
- include package/VERSION
132
-
133
129
# license
134
130
include LICENSE
135
131
@@ -144,18 +140,20 @@ You can use the ``setuptools`` package to build a install script for your packag
144
140
145
141
import setuptools
146
142
try:
147
- import setuptools_utils
143
+ import pkg_utils
148
144
except ImportError:
149
- import pip
150
- pip.main(['install', 'git+https://github.com/KarrLab/setuptools_utils.git#egg=setuptools_utils'])
151
- import setuptools_utils
145
+ import subprocess
146
+ import sys
147
+ subprocess.check_call(
148
+ [sys.executable, "-m", "pip", "install", "pkg_utils"])
149
+ import pkg_utils
152
150
import os
153
151
154
152
name = 'intro_to_wc_modeling'
155
153
dirname = os.path.dirname(__file__)
156
154
157
155
# get package metadata
158
- md = setuptools_utils .get_package_metadata(dirname, name)
156
+ md = pkg_utils .get_package_metadata(dirname, name)
159
157
160
158
# install package
161
159
setup(
@@ -187,11 +185,6 @@ You can use the ``setuptools`` package to build a install script for your packag
187
185
188
186
# packages not prepared yet
189
187
packages=setuptools.find_packages(exclude=['tests', 'tests.*']),
190
- package_data={
191
- name: [
192
- 'VERSION',
193
- ],
194
- },
195
188
entry_points={
196
189
'console_scripts': [
197
190
'intro-to-wc-modeling = intro_to_wc_modeling.__main__:main',
0 commit comments