Skip to content

Commit

Permalink
Migrate to Poetry (#14)
Browse files Browse the repository at this point in the history
* Migrate to Poetry

* Update GitHub Actions

* Simplify GitHub Action

* Add pytest version

* Pick version dynamically and update lock file

* Update README

* Python 3.7 compatibility

* Pin black version to allow for Python 3.6

* Update changelog

* Bump version

* Consolidate changelog updates
  • Loading branch information
vanshg authored Nov 1, 2022
1 parent 44129dc commit 88aea5a
Show file tree
Hide file tree
Showing 11 changed files with 590 additions and 64 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache: 'poetry'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install dev dependencies
run: pip install -r dev-requirements.txt
run: poetry install
- name: test code
run: pytest
run: poetry run pytest
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,10 @@ This will return the smile services endpoint as a json object and can then be u

## Development

Reference: https://virtualenv.pypa.io/en/latest/installation.html

1. Set up virtual env.
2. After checking out the repo, run `pip install -r requirements` to install all required packages.
1. Ensure you have `poetry` installed: https://python-poetry.org/docs#installation
2. After checking out the repo, run `poetry install` -- this sets up a virtualenvironment and install all required packages.
1. Run `poetry shell` to activate the virtual environment.
2. Run `poetry env info` to get details about the virtual environment

## Deployment

Expand All @@ -571,23 +571,27 @@ This is the https://packaging.python.org/tutorials/packaging-projects/ that you
#### Testing

Tests are based on `pytest`.

To run tests run `pytest` in the root folder of the project

If your virtual environment is active, run `poetry run pytest` from the root of the project to run the tests.

If you are outside the virtual environment, run `poetry run pytest` from the root of the project to run the tests.

#### Deployment

To release a new version:

- Update the version number in setup.py
- Run `python setup.py sdist` to build package.
- Run `twine upload dist/*` to publish package.
- Bump the version number in `pyproject.toml` (the version in `smile_id_core/__init__.py` will pick this up)
- Update `changelog.md` with the new version number and the changes made
- Run `poetry build` to build package.
- Ensure your PyPI credentials are propery configured
- Run `poetry publish` to publish package.

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/smileidentity/smile-identity-core-python
Bug reports and pull requests are welcome on GitHub at https://github.com/smileidentity/smile-identity-core-python-3

Please format the code with [black](https://github.com/psf/black) prior to submitting pull requests, by running:
```
black .
poetry run black .
```
from the project's root.
14 changes: 10 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# Changelog
All notable changes to this project will be documented in this file.
## [Unreleased] - 2022-10-19
## Changed
* Moved information of python version to the class initialization.

## [1.0.9] - 2022-11-01

### Added
- Python 3.11 support

### Changed
- Project is now built with [Poetry](https://python-poetry.org)
- Moved information of python version to the class initialization

## [0.0.13] - 2020-09-16
### Added
* Created changelog
* Fixed job status error string format
* Added black for code formatting
* Fixed python semantics
* Moved zipfile out from webapi class
* Moved zipfile out from webapi class
2 changes: 0 additions & 2 deletions dev-requirements.txt

This file was deleted.

Loading

0 comments on commit 88aea5a

Please sign in to comment.