Metadata-Version: 2.5
Name: qmenta-client
Version: 4.0.0
Summary: Python client lib to interact with the QMENTA platform.
Project-URL: Homepage, https://www.qmenta.com/
Project-URL: Documentation, https://docs.qmenta.com/client/
Author-email: QMENTA <dev@qmenta.com>
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: <4,>=3.10
Requires-Dist: qmenta-core<7,>=6.0.0
Description-Content-Type: text/markdown

# QMENTA client library
This library allows interaction with the QMENTA platform.
It works with Python 2 and 3. We recommend using Python 3.
Check the [tutorial](https://docs.qmenta.com/client/tutorial.html) and
[docs](https://docs.qmenta.com/client/index.html).

## Installation
If you do not have PIP installed, on Ubuntu/Debian, it can be installed by:

```bash
sudo apt-get install python3-pip
```

Install QMENTA client lib using PIP:

```bash
pip install qmenta-client
```

## Development
### How to install dependencies on MacOS
Download and install Python 3.10 from https://www.python.org/downloads/ 

Install Xcode Command Line Tools:

```bash
xcode-select --install
```

Install [uv](https://docs.astral.sh/uv/getting-started/installation/), then
install the Python dependencies of QMENTA client library:

```bash
cd mintapi/
uv sync
```

Run the unit tests and build the docs:

```bash
uv run pytest test/unittesting
uv run sphinx-build -W doc build/docs
```

The docs need Python 3.10–3.12 (Sphinx 5 does not support Python 3.13). If
your default Python is newer, prefix the commands with `UV_PYTHON=3.12`.

## Install pre-commit hook: Formatting and linting

This hook formats the Python code with [Black](https://github.com/psf/black) and checks for linting
errors with [flake8](https://flake8.pycqa.org/en/latest/). If one of the tools fails, the code will be 
left formatted but there won't be a commit, so you will have potentially fix the linting errors and then stage and 
commit the formatted files.

In order to install this hook, first install the following Python library in your Python environment:

```bash
pip install pre-commit
```

Then run the following command to install the pre-commit hook:

```bash
pre-commit
pre-commit install
pre-commit autoupdate
```

Check that it executes properly by running:

```bash
pre-commit run --all-files
```

A more in-depth explanation of the `pre-commit` utility can be found [here](https://pre-commit.com/#quick-start).

## Install commit-msg hook: JIRA issue in commit message

This hook inserts a prefix with the JIRA issue identifier, so that 
commits are linked to their issue. It runs after your commit message is written, and the JIRA issue identifier is 
extracted from the branch name.

For example, if you are working in issue NEURO-1234, and you write a commit message like the following: 
"Updated requirements", the final commit message will be "NEURO-1234 - Updated requirements"

In order to install this hook, open a terminal in your local copy of the repository and run the following commands:

```bash
wget -q -O .git/hooks/commit-msg https://bit.ly/2SZ5WJO
chmod 777 .git/hooks/commit-msg
```

### Unit Tests
Run tests using script file

```bash
scripts/run_unit_tests.sh
```
### API Tests
Warning: needs the `.env` file with the following configuration and credentials
`QMENTA_PLATFORM_LOCATION=https://platform.qmenta.com`, 
`QMENTA_PLATFORM_USR` from  `qmenta_tools` project secret "prod_user" and
`QMENTA_PLATFORM_PSW` from `qmenta_tools` project secret "prod_password"


Run tests using script file

```bash
scripts/run_API_tests.sh
```

### Keep track of changes

Check the CONTRIBUTING.md file to see how to use scriv and keep track of the changes

### Release in master

Update your local branches

```bash
git checkout develop && git pull
git checkout master && git pull
```

Create a new branch for releasing (X.Y.z is the version to release)

```bash
git checkout -b release-X.Y.z
git merge develop
scriv collect # update changelog
git push --set-upstream origin release-X.Y.z
```

Make and commit other changes, such as updating changelog

```bash
git commit -am "Update repository code for release"
git push
```

Create a Pull Request, wait for approvals and merge the release branch to master.

After release, merge the changes in master to develop

```bash
git checkout develop && git pull && git merge master
```
