Skip to content

Commit 77ff30d

Browse files
authored
Merge pull request #70 from flying-sheep/patch-1
Fixed multiple small issues in the practicalities
2 parents b8a4e4c + 0bf4570 commit 77ff30d

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

_practicalities/intro.md

+20-15
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ correctly tagged, if I issue the following:
4646

4747
$ python -c 'import fictitious; print(fictitious.__version__)'
4848
1.3.2
49-
$ pip install fiction --upgrade
49+
$ pip install fictitious --upgrade
5050

5151
Either my system will install 2.0, which will not work, on the worst case
5252
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
6262
python version you have to (or decided to) run, making sure that everything
6363
works make the community strong.
6464

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
6666
2 installations. Having pip 9.0+ is not a guaranty to flawless upgrade. But pip
6767
9.0+ does have a number of safety check not available on previous versions.
6868

6969
Having a version of pip < 9.0 can lead your system to try to upgrade to
7070
non-compatible versions of Python packages even if these are marked as
7171
non-compatible.
7272

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
7474
transition, it is the slowest part of the ecosystem to update, and is the only
7575
piece that requires action of all Python users.
7676

@@ -83,8 +83,8 @@ This will install the latest version of pip and setuptools.
8383

8484
You can issue the following to see the version of pip:
8585

86-
$ pip --version
87-
9.0.0
86+
$ pip --version
87+
9.0.0
8888

8989
All good.
9090

@@ -96,14 +96,14 @@ If you are on a system for which no wheel is available, pip will try to
9696
install a source distribution (aka `sdist`).
9797

9898
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
100100
if library authors have taken time to mark their library as Python 3 only, the
101101
`python_requires` argument to `setup()` may not be recognized and installation
102102
will fail.
103103

104104
Use the following to check setuptools version :
105105

106-
$ python -c 'import setuptools; print(setuptools.__version__)
106+
$ python -c 'import setuptools; print(setuptools.__version__)'
107107
24.2.0
108108

109109
Again make sure to upgrade pip and setuptools to make sure you have an up to
@@ -157,7 +157,7 @@ setup(
157157

158158
Change `>=3.3` accordingly depending on what version your library decides to
159159
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`).
161161

162162
This will make [PyPI aware](https://github.com/pypa/warehouse/pull/1448) that
163163
your package is Python 3.3+ only, and [allow
@@ -172,7 +172,7 @@ they will get the right version of your library.
172172
It is recommended **not** to invoke `setup.py` directly either with `install` or
173173
`develop` subcommands. These may not correctly resolve dependencies, and can
174174
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.
176176

177177
Check in scripts, and documentation that the correct installation command is
178178
used.
@@ -184,8 +184,7 @@ user early enough _and_ providing useful error messages.
184184

185185
## Runtime warning on master
186186

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)
189188

190189
```
191190
import warnings
@@ -222,7 +221,7 @@ if sys.version_info < (3,):
222221
Unfortunately Frobulator 6.0 and above are not compatible with Python 2
223222
anymore, and you still ended up with this version installed on your system.
224223
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:
226225
227226
$ pip install pip setuptools --upgrade
228227
@@ -257,13 +256,19 @@ of setuptools.
257256

258257
The regular expression to check for validity of pep440 can be find below:
259258

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*))?
261266

262267

263268
## fail early in setup.py
264269

265270
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
267272
migrate to Python 3). You can (try to) conditionally import pip and check for
268273
its version but this might not be the same pip. Failing early is important to
269274
make sure the Python installation does not install an incompatible version.
@@ -288,7 +293,7 @@ implement them.
288293
It is possible to release a meta-package that has _virtually_ no code and rely
289294
on conditional dependency to install its actual core code on the user system.
290295
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
292297
this approach is _doable_ this can make imports confusing.
293298

294299
## Depend on setuptools

0 commit comments

Comments
 (0)