aiblocks 1.4.0
a dummy version of ai blocks to test security
Requires Python: >=3.8

# Python Package Template

This is a basic template for Python packages that includes packaging, as
well as automated testing, linting and formatting.

The automation of the latter components is done using [tox](https://tox.readthedocs.io/en/latest/),
which runs the tests against an isolated build of the package (in an
independent virtual environment) and runs three static code analysis/
formatting tools against the source code. These are

- [black](https://black.readthedocs.io/en/stable/index.html): Standardises
code formatting

- [isort](https://github.com/timothycrosley/isort): Sorts imports

- [flake8](https://gitlab.com/pycqa/flake8): Enforces pep8 and pep257
and catches some potential bugs

- [mypy](http://mypy-lang.org/): Static type checking.

The `black` and `isort` will actually reformat the code itself, whereas
`flake8` and `mypy` will return the list of errors they find.

## How to use this template

Clone the bitbucket repo:

    git clone git@bitbucket.org:optellum/python_package_template

Remove the git history of the template:

    cd python_package_template
    rm -rf .git

Rename the `PACKAGE/` directory as desired and propagate this change to
the following files:

- `tox.ini`: Update the variables under  `[vars]` and in the
`[isort]` to that of the renamed directory;

- `setup.cfg`:  Update the variables under `[metadata]` and
add any of the packaged dependencies in `install_requires` under
`[options]`.

Use this command to list all the variables requiring changing in `tox.ini` and `setup.cfg` :

    grep '<.*>' tox.ini setup.cfg

If migrating from an existing package to this format, move the package
 source to the package directory (likely overwriting the existing
`__init__.py`) and move any tests to the `test/` directory. If a
different test runner to pytest is being used, then update the
`[testenv]` section of `tox.ini` accordingly.

The package version is [single-sourced](https://packaging.python.org/guides/single-sourcing-package-version/)
in the `__version__` variable set in the top-level `__init__.py` file.
This may need to be added if it was overwritten during migration.
**NOTE**: package installation will fail if setup.py cannot find the
`__version__` variable in `__init__.py`.

Finally, replace this README with one appropriate for the package.

## Testing

The following exemplar "test virtualenv", `venv_tox/`, can be used as a standard across all packages to
test with `tox` (deploy with `twine`, etc...):

    mkdir -p /path/to/your/venvs
    cd /path/to/your/venvs
    virtualenv -p python3.8 venv_tox
    venv_tox/bin/pip install tox gitpython twine
    source venv_tox/bin/activate

then, to run the tests, use:

    tox

## Deployment

Please note that these deployment instructions refer to the deployment of packages that are based on the
python_package_template, rather than the template itself. Do not deploy this template.

To deploy a package to the Nexus Repository Manager, first build the
source distribution and wheel using setuptools (this could be done e.g. from `venv_tox/`):

    python3 setup.py sdist bdist_wheel

To check the git hash in the package use:

    ./resources/check_git_hash.sh

(in addition to auxiliary bash scripts, the `resources` folder also holds static files, such as data or models, used in unit tests)

Then use `twine` to publish the package to Nexus, either by specifying the repository url explicitly:

    export REPOSITORY_URL=https://nexus.labs.optellum.co.uk/repository/pypi/
    twine upload --repository=optellum-pypi dist/*

or, if you have an upload configuration set in `$HOME/.pypirc`, simply specify the repository by name:

    twine upload --repository=optellum-pypi dist/*

An example `.pypirc` file to enable this would be:
```ini
[distutils]
index-servers =
    optellum-pypi

[optellum-pypi]
repository: https://nexus.labs.optellum.co.uk/repository/pypi/
username: {nexus_username}
password: {nexus_password}
```