-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IO-557][internal] Move to use Poetry for packaging and publishing #512
Merged
Merged
Changes from 49 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
126c52f
WIP pyproject and poetry files
41a279b
Fixes for the entrypoint and extras
90f361b
Revert version to actual current
633cf6a
Revert name
ac51906
Reupdate name
99206af
Added debugpy to dev dependencies
54aaa33
Added some docs
137918b
Added ISSUE TEMPLATE because it was a good opportunity to.
55b1556
Update publish script
5fa5a34
Merge branch 'master' into io-557_move_to_poetry
01b6ce7
Version bump
396ea79
Pinning numpy at 1.23.0
4cf4585
Reducing test matrix, as 3.6 is very old
65b1a29
Setting more flexible numpy version
2c39d1f
Flows install using poetry
d7b540f
Corrected add syntax to install syntax in flows
3589078
Lock file
92b4ae5
Adding env invoke
1801956
Poetry run added
374a288
Add no interaction
d1e7974
trying a different approach
b8782e3
YAML issues
11bd8e7
Fixed variable issue
bfa3521
Installed toml dependency
5221f3b
Giving up on toml
2a1b42d
Tweak to try different version of command
6f19fb5
One more go
8d650e2
New version of the CI/CD flow
owencjones ebd05e4
Added in name and action
owencjones 51dc349
Change trigger
owencjones 2a42127
Trying a new action
owencjones fb5306d
Added install and tests
owencjones ee07f7d
Minor semantic changes
owencjones 1fcbc25
Still not installing pytest, trying a different approach
owencjones 3f9b997
Tweaking install line
owencjones 1fbf144
Update lock file
94d5e95
Changing to run pytest
81a750f
Pytest maybe doesn't work with 3.8 anymore
f937e31
Fixed Dependency issue
ac430b6
Added lock file
5da45f2
Issue with flake8
2ae0f41
Upgrade to gitflow, not going to fix the pytest modules just yet
a0b11b7
Resolved deps, test changes
5ffd601
Removed cc block to see if that broke it
3806751
Syntax issue in action
6214a8e
Resolves all deps and should install and test
3ad9e9a
Install local module with all deps
00c5750
Removed 3.11 as we don't technically support it yet
503a82a
Updated the deployment technique
cdc900a
Merge branch 'master' into io-557_move_to_poetry
21cbf8c
Incorporated JSONSchema update from other branch
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Bug Report | ||
description: File a bug report | ||
title: "[Bug]: " | ||
labels: ["bug", "triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for taking the time to fill out this bug report! | ||
- type: input | ||
id: contact | ||
attributes: | ||
label: Contact Details | ||
description: How can we get in touch with you if we need more info? | ||
placeholder: ex. email@example.com | ||
validations: | ||
required: false | ||
- type: textarea | ||
id: what-happened | ||
attributes: | ||
label: What happened? | ||
description: Also tell us, what did you expect to happen? | ||
placeholder: Tell us what you see! | ||
validations: | ||
required: true | ||
- type: textbox | ||
id: version | ||
attributes: | ||
label: What version of darwin-py were you using? | ||
description: Run darwin-py --version at command line and paste the output here | ||
validations: | ||
required: true | ||
- type: checkboxes | ||
id: terms | ||
attributes: | ||
label: Code of Conduct | ||
description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) | ||
options: | ||
- label: I agree to follow this project's Code of Conduct | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,40 @@ | ||
name: Testing | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ubuntu: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
ci: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, "3.10"] | ||
|
||
python-version: ["3.8", "3.9", "3.10"] | ||
poetry-version: ["1.3.1"] | ||
os: [ubuntu-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install wheel | ||
pip install --upgrade setuptools | ||
pip install --editable ".[test,ml,medical]" | ||
|
||
- name: Run tests | ||
run: pytest | ||
windows: | ||
runs-on: windows-latest | ||
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
- run: pip install pip --upgrade | ||
- name: Setup Poetry | ||
uses: abatilo/actions-poetry@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
poetry-version: ${{ matrix.poetry-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
poetry install --no-interaction --no-root --all-extras -vvv | ||
pip install wheel | ||
pip install --upgrade setuptools | ||
pip install --editable ".[test,ml,medical]" | ||
|
||
- name: Run tests | ||
pip install --editable ".[test,ml,medical,dev]" | ||
pip install pytest pytest-describe | ||
- name: Run Tests | ||
run: pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Developing for `darwin-py` | ||
|
||
`darwin-py` uses a `pyproject.toml` file, and manages it with `poetry` | ||
|
||
- [Developing for `darwin-py`](#developing-for-darwin-py) | ||
- [Development environment](#development-environment) | ||
- [Basic poetry commands](#basic-poetry-commands) | ||
- [Add a package to general dependencies:](#add-a-package-to-general-dependencies) | ||
- [Add a package to one of the extras groups](#add-a-package-to-one-of-the-extras-groups) | ||
- [Add a package to the poetry dev dependencies](#add-a-package-to-the-poetry-dev-dependencies) | ||
- [The `pyproject.toml` file](#the-pyprojecttoml-file) | ||
|
||
|
||
## Development environment | ||
|
||
You can either: | ||
* Install a `poetry` environment, and work with that, or | ||
* Install `darwin-py` using `pip` from Pypi.org, and make your own arrangements for debugging. | ||
|
||
The recommended setup is to install poetry, and use this to setup a dev environment: | ||
|
||
```sh | ||
$ python --version # must be 3.9 or greater for development tools | ||
$ pip install poetry | ||
$ poetry install --extras "test ml medical dev" -G dev | ||
``` | ||
|
||
This creates a `virtualenv` for the project. If you prefer, you can use `venv` by running this command before `poetry install`: | ||
|
||
```sh | ||
$ python -m venv .venv | ||
``` | ||
|
||
You can give it a different name if you wish, but the name `.venv` is pre-ignored in the `.gitignore` file. | ||
|
||
|
||
## Basic poetry commands | ||
|
||
### Add a package to general dependencies: | ||
```sh | ||
$ poetry add [PACKAGENAME] | ||
``` | ||
|
||
|
||
### Add a package to one of the extras groups | ||
|
||
(these are those that are used in `pip install darwinpy[option]` type commands - ours are `test`, `ml`, `medical`, and `dev` - `dev` is for developers who don't want to use poetry - so they can install using `pip`) | ||
|
||
```sh | ||
$ poetry add [PACKAGENAME] --extras="extra group names" | ||
``` | ||
|
||
|
||
Packages added this way will be installable with `pip` once a release has been made to PyPi. | ||
|
||
|
||
### Add a package to the poetry dev dependencies | ||
|
||
```sh | ||
$ poetry add [PACKAGENAME] -G groupname | ||
``` | ||
|
||
Currently the only group is `dev` and contains dev tools for developers using `poetry`. `poetry` groups have no effect on packaging, and things installed here will not be packaged. | ||
|
||
## The `pyproject.toml` file | ||
|
||
This was a necessary change for PEP-517, but also allows us a central place to add configuration. | ||
|
||
Items in the `pyproject.toml` file that are grouped as `[tool.X]` are configuration settings for specific tools on the system. | ||
|
||
For example, settings for `mypy` static type analyser, are in the `[tool.mypy]` group. | ||
|
||
A plugin is installed that allows `flake8` to take its configuration from this file, even though usually it only works with `setup.cfg` and `.flake8`. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not ticket related, just useful in terms of getting better issues in