semvec/pypi-packages huggingface dataset:
flask-sample 0.4a4
A sample Flask app
Requires Python: >=3.5
Keywords: sample setuptools development flask

# Sample flask app project

## About
Sample flask application packaged and ready to deploy

## Goals
The main project goals are:
- sample skeleton for fast start develop;
- usage flask_sample package from pypi for checking docker python web app packaging;

## Deploying on production
```
pip3 install flask-sample[gunicorn]
gunicorn --bind 127.0.0.1:8088 flask_sample.wsgi
```

## Setup and configure development environment
Clone repository
```
git clone git@github.com:ph20/flask-sample.git
```

Create virtual environment with venv module
```
cd flask-sample
python3 -m venv ./venv
source ./venv/bin/activate
pip install -e .[dev]
```
Try to run application in development mode

```python ./src/flask_sample/app.py```

## Preparing python packages
source package ```python setup.py build sdist```

wheel package ```python setup.py build bdist_wheel```

Find packages in `dist` directory
devopsjourney 0.0.4
A small example package
Requires Python: >=3.6


# Make sure you have upgraded version of pip
Windows
```
py -m pip install --upgrade pip
```

Linux/MAC OS
```
python3 -m pip install --upgrade pip
```

## Create a project with the following structure
```
packaging_tutorial/
├── LICENSE
├── pyproject.toml
├── README.md
├── setup.cfg
├── src/
│   └── example_package/
│       ├── __init__.py
│       └── example.py
└── tests/
touch LICENSE
touch pyproject.toml
touch setup.cfg
mkdir src/mypackage
touch src/mypackage/__init__.py
touch src/mypackage/main.py
mkdir tests
```

## pyproject.toml 

This file tells tools like pip and build how to create your project

```
[build-system]
requires = [
    "setuptools>=42",
    "wheel"
]
build-backend = "setuptools.build_meta"
```
build-system.requires gives a list of packages that are needed to build your package. Listing something here will only make it available during the build, not after it is installed.

build-system.build-backend is the name of Python object that will be used to perform the build. If you were to use a different build system, such as flit or poetry, those would go here, and the configuration details would be completely different than the setuptools configuration described below.


# Setup.cfg setup
Using setup.cfg is a best practice, but you could have a dynamic setup file using setup.py

```
[metadata]
name = example-pkg-YOUR-USERNAME-HERE
version = 0.0.1
author = Example Author
author_email = author@example.com
description = A small example package
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/pypa/sampleproject
project_urls =
    Bug Tracker = https://github.com/pypa/sampleproject/issues
classifiers =
    Programming Language :: Python :: 3
    License :: OSI Approved :: MIT License
    Operating System :: OS Independent

[options]
package_dir =
    = src
packages = find:
python_requires = >=3.6

[options.packages.find]
where = src

```
# Running the build
### Make sure your build tool is up to date
Windows
```
py -m pip install --upgrade build
```
Linux/MAC OS
```
python3 -m pip install --upgrade build
```


### Create the build
```
py -m build
```













### References
https://packaging.python.org/tutorials/packaging-projects/
niceback 0.4.2
Human-readable tracebacks in Jupyter notebooks

# Nicer error messages for Python

Other languages such as C++ have gotten quite useful error messages and
diagnostics with tips on how the fix the problems but Python is still stuck
with the bare stacktraces that are very intimidating and often not very helpful.

![Niceback](https://raw.githubusercontent.com/Tronic/niceback/master/docs/with-niceback.png)
**Niceback backtrace shows where the user has terminated the program.**

Niceback hides the irrelevant IPython/notebook internals and concisely shows
what happened (the program was interrupted) and where that happened. This could
further be improved by converting the KeyboardInterrupt message into something
more suitable, like "You stopped the program", but what you see above is just
the default handling that never considered this particular error.

Although IPython and Google Colab developers have done their tweaks to improve
backtraces, it is all too apparent that much remains to be done:

![Colab](https://raw.githubusercontent.com/Tronic/niceback/master/docs/without-niceback.png)
**Standard backtrace from Google Colab.**

Even for the experienced programmer, it is tedious to read through the wall of
text to find the relevant details of what went wrong.

In more complex situations where one might get many screenfuls of standard
traceback, Niceback produces scrollable outputs that concentrate on the relevant
details but also provide variable inspectors on each frame where it may be
relevant:

![Nested exceptions](https://raw.githubusercontent.com/Tronic/niceback/master/docs/nested.png)
**Niceback output with nested exceptions.**


## Usage

At the beginning of your Notebook:

```ipython
!pip install niceback
%load_ext niceback
```

## Background

This project is a proof of concept, showing a modern way to format error
messages in a human-readable manner. Heuristics are used to hide (by default)
irrelevant stack frames and show the actual location of the problem. Since it
would otherwise be impossible to find out the variable contents after the program
has crashed, a variable inspector built into each stack frame quickly reveals
problems with the variables mentioned at the source of error. Care is taken to
add revelant details such as notebook input field numbers and class names not
normally present in Python tracebacks, while hiding overly long paths and other
clutter.

All output is in HTML and as such only works in Jupyter notebooks and other
browser-based systems (this should be useful for web development frameworks as
well). This allows interactivity and much better layout than that of the text
console.

## License

Public Domain or equivalent.

## Help wanted

I won't be able to maintain this all by myself. If you like the idea of nicer
tracebacks, please offer your help in development! Pull requests are welcome
but it would be even better if you could pick up the whole project as your own.

As of now, this project is in no way properly polished for release. Yet, it is
useful enough to such a degree that I always use it in my notebooks, and it
really makes Python development a much smoother experience.