Skip to content
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

Switch build from setuptools to Poetry and move tests path #303

Merged
merged 31 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
15410cf
Adjusted postCreateCommand for poetry
kenibrewer Jul 4, 2023
15cd43d
Refactored to put processing in function #304
kenibrewer Jul 6, 2023
69323ab
Fixed test paths
kenibrewer Jul 6, 2023
b0b8395
Adjusted workflows for poetry
kenibrewer Jul 6, 2023
52f24e8
Add pytest-cov to dependencies
kenibrewer Jul 6, 2023
b4ddc59
Merge branch 'master' into feature/setup-pyproject-toml
kenibrewer Jul 6, 2023
5fc8143
Fixed python version in workflows
kenibrewer Jul 6, 2023
66df556
Fixed action version
kenibrewer Jul 6, 2023
9139a9a
Changed to new default branch name
kenibrewer Jul 9, 2023
8adeba9
Added Python .gitignore template content
kenibrewer Jul 9, 2023
c09c75b
Removed poetry export precommit hook
kenibrewer Jul 9, 2023
39a48d4
Merge branch 'master' into feature/setup-pyproject-toml
kenibrewer Jul 9, 2023
ee0e626
Added master back to workflows to allow pipelines to run during trans…
kenibrewer Jul 9, 2023
02f3dfd
Changed global variables to all caps
kenibrewer Jul 9, 2023
357e54f
Removed poetry-lock precommit hook
kenibrewer Jul 9, 2023
87be24b
Changed poetry setup to match postCreateCommand.sh
kenibrewer Jul 9, 2023
fcf21ab
Changed paths and files to more inclusive naming
kenibrewer Jul 9, 2023
d909748
Renamed test data paths
kenibrewer Jul 11, 2023
882278e
Merge branch 'master' into feature/setup-pyproject-toml
kenibrewer Jul 11, 2023
3fe4658
Update CITATION.cff and version
kenibrewer Aug 5, 2023
55b619f
Updated collate to use sqlite3 module not CLI
kenibrewer Aug 7, 2023
ea0e6f2
Updated poetry.lock
kenibrewer Aug 7, 2023
bc1c819
Adjust test_DeepProfiler to use fixtures
kenibrewer Aug 7, 2023
dbde5f4
Merge branch 'master' into feature/setup-pyproject-toml
kenibrewer Aug 7, 2023
f5f2b99
Documentation updates for poetry
kenibrewer Aug 8, 2023
86836af
Fixed misconfigured assertions #314
kenibrewer Aug 8, 2023
fafb8b3
Rename python-app.yml to pytest.yml
kenibrewer Aug 9, 2023
3031f65
Added pytest-cov for cli arg support
kenibrewer Aug 9, 2023
d0d098f
Update author list
kenibrewer Aug 10, 2023
70e0118
Add sqlite connection/cursor closing
kenibrewer Aug 10, 2023
a2a413d
Add connection.close() to collate
kenibrewer Aug 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .devcontainer/postCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /usr/bin/env bash

python -m pip install -r requirements-dev.txt
python -m pip install -e .
pre-commit install --install-hooks
python -m pip install poetry
poetry config virtualenvs.in-project true --local
kenibrewer marked this conversation as resolved.
Show resolved Hide resolved
poetry install --all-extras
poetry run pre-commit install --install-hooks
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/documentation_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
label: File location of the documentation
description: >
Please provide the source of the documentation that this issue is referencing.
placeholder: Example - https://github.com/cytomining/pycytominer/edit/master/docs/index.rst
placeholder: Example - https://github.com/cytomining/pycytominer/edit/main/docs/index.rst
validations:
require: true
- type: textarea
Expand Down
59 changes: 48 additions & 11 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,62 @@ name: Code coverage

on:
push:
branches: [master]
branches:
- main
# Temporary inclusion of master branch during default branch name transition
- master
pull_request:
branches: [master]
branches:
- main
# Temporary inclusion of master branch during default branch name transition
- master

jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@master
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
pip install .[collate,cell_locations]
pytest --cov=./ --cov-report=xml
python-version: 3.11
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
kenibrewer marked this conversation as resolved.
Show resolved Hide resolved
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
#----------------------------------------------
# run test suite and output coverage file
#----------------------------------------------
- name: Test with pytest
run: poetry run pytest --cov=./ --cov-report=xml
#----------------------------------------------
# upload coverage stats
# (requires CODECOV_TOKEN in repository secrets)
#----------------------------------------------
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pre-commit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ name: pre-commit-ci
on:
pull_request:
branches:
- main
# Temporary inclusion of master branch during default branch name transition
- master
jobs:
pre-commit-ci:
name: Run pre-commit checks on changed files
runs-on: ubuntu-latest
steps:
- name: Checkout repo with all branches and tags
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup python 3.9
Expand Down
32 changes: 7 additions & 25 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,17 @@ on: [release]
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: [3.8]

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install pypa/build
run: python -m pip install setuptools build wheel --user

- name: Build a binary wheel
run: python setup.py sdist bdist_wheel

- uses: actions/checkout@v3
- name: Publish any distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
uses: JRubics/poetry-publish@v1.17
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

ignore_dev_requirements: "yes"
- name: Publish tagged distribution 📦 to PyPI
uses: JRubics/poetry-publish@v1.17
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
69 changes: 69 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This workflow will install Python dependencies, run tests and black with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python build

on:
push:
branches:
- main
# Temporary inclusion of master branch during default branch name transition
- master
pull_request:
branches:
- main
# Temporary inclusion of master branch during default branch name transition
- master

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest]
env:
OS: ${{ matrix.os }}
# This is needed to avoid a warning from SQLAlchemy
# https://sqlalche.me/e/b8d9
# We can remove this once we upgrade to SQLAlchemy >= 2.0
SQLALCHEMY_SILENCE_UBER_WARNING: "1"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
run: |
python -m pip install poetry
poetry config virtualenvs.in-project true --local
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root --all-extras
#----------------------------------------------
# install pycytominer
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction --only-root
#----------------------------------------------
# run test suite and output coverage file
#----------------------------------------------
- name: Test with pytest
run: |
poetry run pytest
39 changes: 0 additions & 39 deletions .github/workflows/python-app.yml

This file was deleted.

Loading