Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
106 changes: 106 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: build

on:
push:
branches:
- master
tags:
- "*-[0-9]+.*"
pull_request:
branches:
- master

jobs:
build-cross-platform:
name: test ${{matrix.os}} - ${{matrix.python-version}}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [
ubuntu-latest,
windows-latest,
macos-latest
]
python-version: [
'3.7',
'3.8',
'3.9',
'3.10'
]
# Breaks due to https://github.com/jpype-project/jpype/issues/1009
# Should be included once the fix is released
exclude:
- os: windows-latest
python-version: "3.10"

steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v3
with:
python-version: ${{matrix.python-version}}

- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'zulu'

- name: Install ScyJava
run: |
python -m pip install --upgrade pip
python -m pip install -e '.[dev]'

- name: Test ScyJava
run: |
python -m pytest -p no:faulthandler --color=yes

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable

flake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
- name: flake src code
run: |
python -m pip install flake8
python -m flake8 src
- name: flake test code
run: |
python -m flake8 tests



conda-dev-test:
name: Conda Setup & Code Coverage
runs-on: ubuntu-latest
defaults:
# Steps that rely on the activated environment must be run with this shell setup.
# See https://github.com/marketplace/actions/setup-miniconda#important
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
# Create env with dev packages
auto-update-conda: true
python-version: 3.9
environment-file: dev-environment.yml
# Activate imglyb-dev environment
activate-environment: imglyb-dev
auto-activate-base: false
# Use mamba for faster setup
use-mamba: true
mamba-version: "*"
- name: Test imglyb
run: |
python -m pytest tests/ -p no:faulthandler --cov-report=xml --cov=.
# We could do this in its own action, but we'd have to setup the environment again.
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2

89 changes: 0 additions & 89 deletions .github/workflows/python-test-conda.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@
/.eggs/
*egg-info/

# setuptools_scm
src/scyjava/version.py

# Vi
*.swp

# VSCode
.vscode

# Unit test / coverage reports
.coverage
.coverage.*
coverage.xml
coverage.xml
8 changes: 0 additions & 8 deletions .vscode/settings.json

This file was deleted.

2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

34 changes: 34 additions & 0 deletions dev-environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Use this file to construct an environment
# for developing scyjava from source.
#
# mamba env create -f dev-environment.yml
# conda activate scyjava-dev
#
# In addition to the dependencies needed for using scyjava, it includes tools
# for developer-related actions like running automated tests (pytest),
# linting the code (black), and generating the API documentation (sphinx).
# If you want an environment without these tools, use environment.yml.
name: scyjava-dev
channels:
- conda-forge
- defaults
dependencies:
# Project dependencies
- jpype1 >= 1.3.0
- jgo
# Test dependencies
- numpy
- pandas
# Developer tools
- autopep8
- black
- build
- flake8
- pytest
- pytest-cov
- setuptools-scm >= 6.2
# Project from source
- pip
- pip:
- -e .

13 changes: 0 additions & 13 deletions environment-test.yml

This file was deleted.

18 changes: 17 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
# Use this file to construct an environment for working
# with scyjava in a runtime setting
#
# mamba env create
# conda activate scyjava
#
# It includes the dependencies needed for using scyjava but not tools
# for developer-related actions like running automated tests (pytest),
# linting the code (black), and generating the API documentation (sphinx).
# If you want an environment including these tools, use dev-environment.yml.

name: scyjava
channels:
- conda-forge
- defaults
dependencies:
# Project dependencies
- jpype1 >= 1.3.0
- jgo
- scyjava
- openjdk=8
# Project from source
- pip
- pip:
- -e .
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
[build-system]
# Setuptools version constraint ensures PEP 517 compatibility
requires = [
"setuptools >= 40.9.0"
"setuptools >= 45",
"wheel",
"setuptools_scm>=6.2",
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
write_to = "src/scyjava/version.py"

[tool.black]
# This file is autogenerated by setuptools_scm - it cannot be modified
--exclude = "src/scyjava/version.py"
17 changes: 13 additions & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[metadata]
name = scyjava
version = 1.5.2.dev0
author = Curtis Rueden, Philipp Hanslovsky, Edward Evans, Mark Hiner, Gabriel Selzer
author_email = ctrueden@wisc.edu
description = Supercharged Java access from Python
Expand All @@ -18,7 +17,6 @@ classifiers =
Intended Audience :: Education
Intended Audience :: Science/Research
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3 :: 3.6
Programming Language :: Python :: 3 :: 3.7
Programming Language :: Python :: 3 :: 3.8
Programming Language :: Python :: 3 :: 3.9
Expand All @@ -37,7 +35,7 @@ packages = find:
package_dir =
= src
# Ensure any changes to this list are also added to environment.yml AND environment-test.yml!
python_requires = >=3.6
python_requires = >=3.7
install_requires =
jpype1 >= 1.3.0
jgo
Expand All @@ -48,7 +46,18 @@ where = src
[options.extras_require]

# Ensure any changes to this list are also added to environment-test.yml!
test =
dev =
autopep8
black
build
flake8
pytest
pytest-cov
numpy
pandas
setuptools-scm >= 6.2

[flake8]
# See https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
max-line-length = 88
extend-ignore = E203
Loading