@@ -46,7 +46,7 @@ correctly tagged, if I issue the following:
46
46
47
47
$ python -c 'import fictitious; print(fictitious.__version__)'
48
48
1.3.2
49
- $ pip install fiction --upgrade
49
+ $ pip install fictitious --upgrade
50
50
51
51
Either my system will install 2.0, which will not work, on the worst case
52
52
scenario, or fail to install, in which case I will not get the critical 1.4
@@ -62,15 +62,15 @@ not to break for Python 2 users. Python is a community regardless of which
62
62
python version you have to (or decided to) run, making sure that everything
63
63
works make the community strong.
64
64
65
- Make sure you have Pip >= 9.0, this is especially important if you have Python
65
+ Make sure you have Pip ≥ 9.0, this is especially important if you have Python
66
66
2 installations. Having pip 9.0+ is not a guaranty to flawless upgrade. But pip
67
67
9.0+ does have a number of safety check not available on previous versions.
68
68
69
69
Having a version of pip < 9.0 can lead your system to try to upgrade to
70
70
non-compatible versions of Python packages even if these are marked as
71
71
non-compatible.
72
72
73
- Help as many other _ users_ as possible to install pip >= 9.0, for the
73
+ Help as many other _ users_ as possible to install pip ≥ 9.0, for the
74
74
transition, it is the slowest part of the ecosystem to update, and is the only
75
75
piece that requires action of all Python users.
76
76
@@ -83,8 +83,8 @@ This will install the latest version of pip and setuptools.
83
83
84
84
You can issue the following to see the version of pip:
85
85
86
- $ pip --version
87
- 9.0.0
86
+ $ pip --version
87
+ 9.0.0
88
88
89
89
All good.
90
90
@@ -96,14 +96,14 @@ If you are on a system for which no wheel is available, pip will try to
96
96
install a source distribution (aka ` sdist ` ).
97
97
98
98
Installing an ` sdist ` will require setuptools make sure you have setuptools
99
- ` >= 24.2.0` or building Python 3 only libraries is likely to fail. In particular
99
+ ≥ 24.2.0 or building Python 3 only libraries is likely to fail. In particular
100
100
if library authors have taken time to mark their library as Python 3 only, the
101
101
` python_requires ` argument to ` setup() ` may not be recognized and installation
102
102
will fail.
103
103
104
104
Use the following to check setuptools version :
105
105
106
- $ python -c 'import setuptools; print(setuptools.__version__)
106
+ $ python -c 'import setuptools; print(setuptools.__version__)'
107
107
24.2.0
108
108
109
109
Again make sure to upgrade pip and setuptools to make sure you have an up to
@@ -157,7 +157,7 @@ setup(
157
157
158
158
Change ` >=3.3 ` accordingly depending on what version your library decides to
159
159
support. In particular you can use ` >=2.6 ` or ` >=3.5 ` ! Note that this also
160
- support the _ compable with_ syntax: ` ~=2.5 ` (meaning, ` >=2.5 ` and ` <3 ` ).
160
+ support the _ compatible with_ syntax: ` ~=2.5 ` (meaning, ` >=2.5 ` and ` <3 ` ).
161
161
162
162
This will make [ PyPI aware] ( https://github.com/pypa/warehouse/pull/1448 ) that
163
163
your package is Python 3.3+ only, and [ allow
@@ -172,7 +172,7 @@ they will get the right version of your library.
172
172
It is recommended ** not** to invoke ` setup.py ` directly either with ` install ` or
173
173
` develop ` subcommands. These may not correctly resolve dependencies, and can
174
174
install incompatible versions of dependencies. Please recommend and use `pip
175
- install . ` and ` pip install -e .` for regular and developer install.
175
+ install .` and ` pip install -e .` for regular and developer install.
176
176
177
177
Check in scripts, and documentation that the correct installation command is
178
178
used.
@@ -184,8 +184,7 @@ user early enough _and_ providing useful error messages.
184
184
185
185
## Runtime warning on master
186
186
187
- Add a warning at _ runtime_ early on master (before switching to Python 3
188
- only)
187
+ Add a warning at _ runtime_ early on master (before switching to Python 3 only)
189
188
190
189
```
191
190
import warnings
@@ -222,7 +221,7 @@ if sys.version_info < (3,):
222
221
Unfortunately Frobulator 6.0 and above are not compatible with Python 2
223
222
anymore, and you still ended up with this version installed on your system.
224
223
That's a bummer. Sorry about that. It should not have happened. Make sure you
225
- have pip >= 9.0 to avoid this kind of issues, as well as setuptools >= 24.2:
224
+ have pip ≥ 9.0 to avoid this kind of issues, as well as setuptools ≥ 24.2:
226
225
227
226
$ pip install pip setuptools --upgrade
228
227
@@ -257,13 +256,19 @@ of setuptools.
257
256
258
257
The regular expression to check for validity of pep440 can be find below:
259
258
260
- ` ^([1-9]\\d*!)?(0|[1-9]\\d*)(\\.(0|[1-9]\\d*))*((a|b|rc)(0|[1-9]\\d*))?(\\.post(0|[1-9]\\d*))?(\\.dev(0|[1-9]\\d*))? `
259
+ ^
260
+ ([1-9]\\d*!)?
261
+ (0|[1-9]\\d*)
262
+ (\\.(0|[1-9]\\d*))*
263
+ ((a|b|rc)(0|[1-9]\\d*))?
264
+ (\\.post(0|[1-9]\\d*))?
265
+ (\\.dev(0|[1-9]\\d*))?
261
266
262
267
263
268
## fail early in setup.py
264
269
265
270
Leave ` setup.py ` python 2 compatible and fail early. If you detect Python 2
266
- raise a clear error message and ask user to make sure they have pip >9.0 (or
271
+ raise a clear error message and ask user to make sure they have pip > 9.0 (or
267
272
migrate to Python 3). You can (try to) conditionally import pip and check for
268
273
its version but this might not be the same pip. Failing early is important to
269
274
make sure the Python installation does not install an incompatible version.
@@ -288,7 +293,7 @@ implement them.
288
293
It is possible to release a meta-package that has _ virtually_ no code and rely
289
294
on conditional dependency to install its actual core code on the user system.
290
295
For example, Frob-6.0 could be a meta-package which depends on
291
- Frob-real-py2 on Python <3.0, and Frob-real-py3 on Python >= 3.4. While
296
+ Frob-real-py2 on Python < 3.0, and Frob-real-py3 on Python ≥ 3.4. While
292
297
this approach is _ doable_ this can make imports confusing.
293
298
294
299
## Depend on setuptools
0 commit comments