The `tar.gz` file is a Source Archive whereas the `.whl` file is a Built Distribution. Newer pip versions preferentially install built distributions, but will fall back to source archives if needed.
**You should always upload a source archive and provide built archives for the platforms your project is compatible with.**
What can you do with those two file ?
### Install them:
You can use the `.whl` or the `.tar.gz` file to install your package
You can upload your package to [pypi](https://pypi.org), but first you can run test on [https://test.pypi.org/](https://test.pypi.org/). As https://pypi.org is an archive, if you upload broken packages, they will stay there.
You first need to create an account https://test.pypi.org/account/register/
Then we use the `twine` tools that we installed before
You should be able to open a python console anywhere and run:
```python
>>>importexample_pkg
```
When everything is OK, you can create an account on https://pypi.org and use the `twine`command without the `--repository testpypi` option.
## Creating executable software
You can also use `pip` to distribute executable software. To do that, you have to specify the `__main__` function to execute when calling your software in the `setup.py` file.
You can have different executable in this list with the format `EXECUTABLE_NAME=LIBRARY.FILE:FUNCTION`
After the installation, calling `example_pkg`will run your software if your `$PATH` is correctly configured.
## Adding dependencies to your package
As your project will grow more complex, you will split it into different file for code clarity.
Your `__init__.py` file will need to contain a list of all the `.py` files in the `example_pkg` repository:
```python
#!/usr/bin/env python3
# -*-coding:Utf-8 -*
"""
idr library
"""
name="midr"
__all__=["__main__",
"idr","samic","archimedean","archimedean_plots",
"log","narrowpeak","raw_matrix","auxiliary"]
```
As you don't want to reinvente the wheel, you may also import other python library (which could be installed with `pip`). You can specify a list of these library in the `setup.py`file:
```python
setuptools.setup(
...
install_requires=[
'cmake>=3.18'
'scipy>=1.3',
'numpy>=1.16',
'pynverse>=0.1',
'pandas>=0.25.0',
'mpmath>=1.1.0',
'matplotlib>=3.0.0'
],
...
)
```
**Don't forget to specify the version of each dependency to ensure that the function you use are present in the installed library.**
If, some package are required for the installation of your package (for example here `cmake`), you should also add them to the `install_requires`list.