Skip to content

Commit 800bb87

Browse files
committed
Add all extra and document optional dependencies.
1 parent 61d6de0 commit 800bb87

File tree

3 files changed

+78
-11
lines changed

3 files changed

+78
-11
lines changed

README.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Happy testing with PyFunceble!
4646
- [Installation](#installation)
4747
- [Packages \& Versioning](#packages--versioning)
4848
- [PyPi - Python Package Index](#pypi---python-package-index)
49+
- [Optional Dependencies](#optional-dependencies)
4950
- [pyfunceble](#pyfunceble)
5051
- [pyfunceble-dev](#pyfunceble-dev)
5152
- [Container Image Registry](#container-image-registry)
@@ -109,10 +110,36 @@ the OS specific packages _(see below)_.
109110
Here is an overview of the packages and where they are hosted.
110111

111112
| Package | PyPi Link |
112-
|----------------|------------------------------------------|
113+
| -------------- | ---------------------------------------- |
113114
| pyfunceble | https://pypi.org/project/PyFunceble |
114115
| pyfunceble-dev | https://pypi.org/project/PyFunceblee-dev |
115116

117+
### Optional Dependencies
118+
119+
The following dependencies are optional and can be installed if you need them.
120+
121+
| Dependency | Description |
122+
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
123+
| `all` | Install all functional dependencies. Basically all but `dev`, `test` and `docs`. _When a binary and non binary version is available, the binary version is installed._ |
124+
| `full` | Install all dependencies listed below. _When a binary and non binary version is available, the binary version is installed._ |
125+
| `psql`, `postgresql` | **Build** and install the dependencies required to interact with PostgreSQL. |
126+
| `psql-binary`, `postgresql-binary` | **Install** the dependencies required to interact with PostgreSQL - from binary. |
127+
| `docs` | Install the dependencies required to build the documentation. |
128+
| `test` | Install the dependencies required to run the tests. |
129+
| `dev` | Install the dependencies required to develop PyFunceble. |
130+
131+
They are intended to be installed through the following syntax:
132+
133+
```shell
134+
pip3 install --user {pkg}[{dependency}]
135+
```
136+
137+
As an example if you want to install the `docs` and `test` dependencies, you should run:
138+
139+
```shell
140+
pip3 install --user pyfunceble[docs,test]
141+
```
142+
116143
### pyfunceble
117144

118145
You can install the **pyfunceble** through `pip3`:
@@ -145,7 +172,7 @@ is available. :smile:
145172
Here is an overview of the packages and where they are hosted.
146173

147174
| Host | Package | Link |
148-
|------------|----------------|----------------------------------------------------------------------------------------------------------|
175+
| ---------- | -------------- | -------------------------------------------------------------------------------------------------------- |
149176
| Docker Hub | pyfunceble | [https://hub.docker.com/r/pyfunceble/pyfunceble](https://hub.docker.com/r/pyfunceble/pyfunceble) |
150177
| Docker Hub | pyfunceble-dev | [https://hub.docker.com/r/pyfunceble/pyfunceble-dev](https://hub.docker.com/r/pyfunceble/pyfunceble-dev) |
151178

@@ -195,7 +222,7 @@ this is probably for you.
195222
Here is an overview of the packages and where they are hosted.
196223

197224
| Host | Package | Repository |
198-
|--------|----------------|-------------------------------------------------------------------------|
225+
| ------ | -------------- | ----------------------------------------------------------------------- |
199226
| GitHub | pyfunceble | `git+https://github.com/funilrys/PyFunceble.git@master#egg=PyFunceble` |
200227
| GitHub | pyfunceble-dev | `git+https://github.com/funilrys/PyFunceble.git@dev#egg=PyFunceble-dev` |
201228
| GitLab | pyfunceble | `git+https://gitlab.com/funilrys/PyFunceble.git@master#egg=PyFunceble` |

docs/use/installation.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ you should prefer the `pyfunceble-dev` package.
2424

2525
## Overview: Installation Method
2626

27-
| OS | Technology | Tools | Link |
28-
| --------- | --------------------------- | ------------ | ------------------------------------ |
29-
| Any | PyPi - Python Package Index | `pip3` | [Link](#pypi---python-package-index) |
30-
| Any | Container Image Registry | `docker` | [Link](#container-image-registry) |
31-
| Any | Git | `pip3` | [Link](#git-repository) |
32-
| Any | Zip File | `pip3` | [Link](#from-source) |
33-
| ArchLinux | AUR Helper | `aur-helper` | [Link](#arch-linux) |
27+
| OS | Technology | Tools | Link |
28+
| --------- | --------------------------- | ------------ | ---------------------------------- |
29+
| Any | PyPi - Python Package Index | `pip3` | [Link](#pypi-python-package-index) |
30+
| Any | Container Image Registry | `docker` | [Link](#container-image-registry) |
31+
| Any | Git | `pip3` | [Link](#git-repository) |
32+
| Any | Zip File | `pip3` | [Link](#from-source) |
33+
| ArchLinux | AUR Helper | `aur-helper` | [Link](#arch-linux) |
3434

3535
## PyPi - Python Package Index
3636

@@ -57,6 +57,33 @@ Here is an overview of the packages and where they are hosted.
5757

5858
you shouldn't use it.
5959

60+
61+
### Optional Dependencies
62+
63+
The following dependencies are optional and can be installed if you need them.
64+
65+
| Dependency | Description |
66+
| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
67+
| `all` | Install all functional dependencies. Basically all but `dev`, `test` and `docs`. _When a binary and non binary version is available, the binary version is installed._ |
68+
| `full` | Install all dependencies listed below. _When a binary and non binary version is available, the binary version is installed._ |
69+
| `psql`, `postgresql` | **Build** and install the dependencies required to interact with PostgreSQL. |
70+
| `psql-binary`, `postgresql-binary` | **Install** the dependencies required to interact with PostgreSQL - from binary. |
71+
| `docs` | Install the dependencies required to build the documentation. |
72+
| `test` | Install the dependencies required to run the tests. |
73+
| `dev` | Install the dependencies required to develop PyFunceble. |
74+
75+
They are intended to be installed through the following syntax:
76+
77+
```shell
78+
pip3 install --user {pkg}[{dependency}]
79+
```
80+
81+
As an example if you want to install the `docs` and `test` dependencies, you should run:
82+
83+
```shell
84+
pip3 install --user pyfunceble[docs,test]
85+
```
86+
6087
### pyfunceble
6188

6289
You can install the **pyfunceble** through `pip3`:

setup.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ def get_requirements(*, mode="standard"):
148148
"postgresql-binary": ["requirements.txt"],
149149
}
150150

151+
ignored_modes_for_all = [
152+
"dev",
153+
"test",
154+
"docs",
155+
"psql",
156+
"postgresql",
157+
"postgresql-binary",
158+
]
159+
151160
if is_win_platform():
152161
for known_mode, files in mode2files.items():
153162
new_files = set()
@@ -163,6 +172,9 @@ def get_requirements(*, mode="standard"):
163172
mode2files[known_mode] = list(new_files)
164173

165174
mode2files["full"] = [y for x in mode2files.values() for y in x]
175+
mode2files["all"] = [
176+
z for x, y in mode2files.items() for z in y if x not in ignored_modes_for_all
177+
]
166178

167179
result = set()
168180

@@ -184,7 +196,7 @@ def get_requirements(*, mode="standard"):
184196

185197
if mode in ("psql", "postgresql"):
186198
result.add("psycopg2")
187-
elif mode in ("psql-binary", "postgresql-binary"):
199+
elif mode in ("psql-binary", "postgresql-binary", "all"):
188200
result.add("psycopg2-binary")
189201

190202
return list(result)
@@ -270,6 +282,7 @@ def get_console_scripts(): # pragma: no cover
270282
"postgresql": get_requirements(mode="postgresql"),
271283
"postgresql-binary": get_requirements(mode="postgresql-binary"),
272284
"full": get_requirements(mode="full"),
285+
"all": get_requirements(mode="all"),
273286
},
274287
description="The tool to check the availability or syntax of domain, IP or URL.",
275288
long_description=get_long_description(),

0 commit comments

Comments
 (0)