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

PyScaffold migration: error-free installation on Windows/Linux for Py 3.8+ and .md instead of .rst #87

Merged
merged 83 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
4018e72
Create .coveragerc
sgbaird Apr 27, 2024
f334cd9
Update .gitignore
sgbaird Apr 27, 2024
98e4d60
Create .readthedocs.yml
sgbaird Apr 27, 2024
025ba1d
Create AUTHORS.md
sgbaird Apr 27, 2024
b5e791f
Create CHANGELOG.md
sgbaird Apr 27, 2024
8df70ff
Create CONTRIBUTING.md
sgbaird Apr 27, 2024
c6d9b6b
static
sgbaird Apr 27, 2024
cbef64f
Create authors.md
sgbaird Apr 27, 2024
105ba29
switch to markdown
sgbaird Apr 27, 2024
e041441
Create changelog.md
sgbaird Apr 27, 2024
2b655a5
update conf.py
sgbaird Apr 27, 2024
77e2dfd
Update Makefile
sgbaird Apr 27, 2024
4e112ee
rename license
sgbaird Apr 27, 2024
965f5b6
Create pyproject.toml
sgbaird Apr 27, 2024
11d082d
Update README.md
sgbaird Apr 27, 2024
265fd01
Update README.md
sgbaird Apr 27, 2024
ffb5bf8
Create contributing.md
sgbaird Apr 27, 2024
6eb4b9c
Create index.md
sgbaird Apr 27, 2024
98a7963
Create license.md
sgbaird Apr 27, 2024
2e8c2cb
Create readme.md
sgbaird Apr 27, 2024
dabd5b4
Create requirements.txt
sgbaird Apr 27, 2024
f9069c4
Create tox.ini
sgbaird Apr 27, 2024
b496aa9
Create conftest.py
sgbaird Apr 27, 2024
dc6974f
Update setup.py
sgbaird Apr 27, 2024
c7c65ee
Create setup.cfg
sgbaird Apr 27, 2024
c5f2db4
Create __init__.py
sgbaird Apr 27, 2024
e4fc503
mv and renames
sgbaird Apr 27, 2024
da0529c
Update conf.py
sgbaird Apr 28, 2024
bdce721
Update setup.cfg
sgbaird Apr 28, 2024
8238e51
Create test_import.py
sgbaird Apr 28, 2024
2cbe2d2
Delete conf.py
sgbaird Apr 28, 2024
2ef9cce
Update index.md
sgbaird Apr 28, 2024
8c207bb
Update requirements.txt
sgbaird Apr 28, 2024
2968693
md instead of rst
sgbaird Apr 28, 2024
c4f460c
pre-commit
sgbaird Apr 28, 2024
110d7f8
Create lm-loop-400x400.gif
sgbaird Apr 28, 2024
d26290e
fix links, add labels
sgbaird Apr 28, 2024
5998470
move from rst to markdown
sgbaird Apr 28, 2024
02e4941
Update .pre-commit-config.yaml
sgbaird May 2, 2024
d9fb08f
Create ci.yml
sgbaird May 2, 2024
829d263
Update .gitignore
sgbaird May 2, 2024
d7f646c
Create .isort.cfg
sgbaird May 2, 2024
ece2c92
Create parking_post_base_47mm.STL
sgbaird May 2, 2024
a088dcb
Create tool_holder_47mm.STL
sgbaird May 2, 2024
64ae66d
Update LICENSE.txt
sgbaird May 2, 2024
2f8565d
Update setup.cfg
sgbaird May 2, 2024
66e4449
Update conf.py
sgbaird May 2, 2024
f1fb37b
Update README.md
sgbaird May 3, 2024
50b1ccc
Update README.md
sgbaird May 3, 2024
d49887e
Rename .readthedocs.yml to .readthedocs.yaml
sgbaird May 3, 2024
8d7936d
Update .pre-commit-config.yaml
sgbaird May 10, 2024
0207fd8
replaced by ci.yml
sgbaird May 10, 2024
ac90c3a
badges and file structure
sgbaird May 10, 2024
6437bea
rm last edited
sgbaird May 10, 2024
cadd179
Update conf.py
sgbaird May 10, 2024
bc68f57
Update requirements.txt
sgbaird May 10, 2024
8721102
Update .gitignore
sgbaird May 10, 2024
a2098ed
Create color_mixing_setup.md
sgbaird May 10, 2024
25b6d53
Update index.md
sgbaird May 10, 2024
d3b968f
placeholder
sgbaird May 10, 2024
1ddf0cd
Create index.rst
sgbaird May 10, 2024
1d2df32
Create color_mixing_demo_config.g
sgbaird May 10, 2024
56ecefe
Create jubilee_wiring_colormix.pdf
sgbaird May 10, 2024
f62086e
last updated
sgbaird May 10, 2024
2c1f3a9
science-jubilee
sgbaird May 10, 2024
a736c44
Merge remote-tracking branch 'upstream/main'
sgbaird May 10, 2024
dba0b35
Update inoculation_tool.md
sgbaird May 10, 2024
bb62cd0
precommit
sgbaird May 10, 2024
bea27f5
precommit
sgbaird May 10, 2024
50584af
_ to - and xrefs
sgbaird May 13, 2024
e184cd0
edit in github
sgbaird May 13, 2024
c99c966
3.8 instead of 3.7
sgbaird May 13, 2024
a546591
toctree
sgbaird May 13, 2024
30ae7ac
just ubuntu
sgbaird May 13, 2024
f5e4cb5
Create logo.ico
sgbaird May 13, 2024
3267a50
html theme options
sgbaird May 13, 2024
163a53c
Update test_import.py
sgbaird May 13, 2024
5db4f41
Update conf.py
sgbaird May 13, 2024
e1b56c6
comment coverage for now
sgbaird May 13, 2024
87586a3
Update test_import.py
sgbaird May 13, 2024
d8fef5c
fix relative link
sgbaird May 13, 2024
97bb184
remove coverage for now
sgbaird May 13, 2024
c72b0d0
forgot to comment some coverage lines
sgbaird May 13, 2024
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
28 changes: 28 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# .coveragerc to control coverage.py
[run]
branch = True
source = science_jubilee
# omit = bad_file.py

[paths]
source =
src/
*/site-packages/

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ body:
label: Steps to reproduce this bug
description: Include a simple code snippet that demonstrates the problem if relevant, along with any errors produced. If this isn't possible, then simply describe the issue as best you can!
value: "### Steps:

1.

2.
Expand All @@ -23,12 +23,12 @@ body:


### Snippet:


```python


// Paste your code here :)
// Paste your code here :)


```"
Expand Down
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Resolves #[Add issue number here]
-->

- [ ] [Inline documentation] is included / updated

126 changes: 126 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# GitHub Actions configuration **EXAMPLE**,
# MODIFY IT ACCORDING TO YOUR NEEDS!
# Reference: https://docs.github.com/en/actions

name: tests

on:
push:
# Avoid using all the resources/limits available by checking only
# relevant branches and tags. Other branches can be checked via PRs.
branches: [main]
tags: ['v[0-9]*', '[0-9]+.[0-9]+*'] # Match tags that resemble a version
pull_request: # Run in every PR
workflow_dispatch: # Allow manually triggering the workflow
schedule:
# Run roughly every 15 days at 00:00 UTC
# (useful to check if updates on dependencies break the package)
- cron: '0 0 1,16 * *'

permissions:
contents: read

concurrency:
group: >-
${{ github.workflow }}-${{ github.ref_type }}-
${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
prepare:
runs-on: ubuntu-latest
outputs:
wheel-distribution: ${{ steps.wheel-distribution.outputs.path }}
steps:
- uses: actions/checkout@v3
with: {fetch-depth: 0} # deep clone for setuptools-scm
- uses: actions/setup-python@v4
id: setup-python
with: {python-version: "3.11"}
- name: Run static analysis and format checkers
run: pipx run pre-commit run --all-files --show-diff-on-failure
- name: Build package distribution files
run: >-
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
tox -e clean,build
- name: Record the path of wheel distribution
id: wheel-distribution
run: echo "path=$(ls dist/*.whl)" >> $GITHUB_OUTPUT
- name: Store the distribution files for use in other stages
# `tests` and `publish` will use the same pre-built distributions,
# so we make sure to release the exact same package that was tested
uses: actions/upload-artifact@v3
with:
name: python-distribution-files
path: dist/
retention-days: 1

test:
needs: prepare
strategy:
matrix:
python:
- "3.8" # oldest Python supported by PSF
- "3.11" # newest Python that is stable
platform:
- ubuntu-latest
# - macos-latest
# - windows-latest
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
id: setup-python
with:
python-version: ${{ matrix.python }}
- name: Retrieve pre-built distribution files
uses: actions/download-artifact@v3
with: {name: python-distribution-files, path: dist/}
- name: Run tests
run: >-
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
tox --installpkg '${{ needs.prepare.outputs.wheel-distribution }}'
-- -rFEx --durations 10 --color yes # pytest args
# - name: Generate coverage report
# run: pipx run coverage lcov -o coverage.lcov
# - name: Upload partial coverage report
# uses: coverallsapp/github-action@master
# with:
# path-to-lcov: coverage.lcov
# github-token: ${{ secrets.GITHUB_TOKEN }}
# flag-name: ${{ matrix.platform }} - py${{ matrix.python }}
# parallel: true

# finalize: # TODO: revisit coverage
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Finalize coverage report
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel-finished: true

publish:
# needs: finalize # TODO: revisit coverage
needs: test
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with: {python-version: "3.11"}
- name: Retrieve pre-built distribution files
uses: actions/download-artifact@v3
with: {name: python-distribution-files, path: dist/}
- name: Publish Package
env:
# TODO: Set your PYPI_TOKEN as a secret using GitHub UI
# - https://pypi.org/help/#apitoken
# - https://docs.github.com/en/actions/security-guides/encrypted-secrets
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: pipx run tox -e publish
27 changes: 0 additions & 27 deletions .github/workflows/documentation.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/test-package.yml

This file was deleted.

58 changes: 53 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,55 @@
.venv/
.ipynb_checkpoints
__pycache__/
# Temporary and binary files
*~
*.py[cod]
*.so
*.cfg
!.isort.cfg
!setup.cfg
*.orig
*.log
*.pot
__pycache__/*
.cache/*
.*.swp
*/.ipynb_checkpoints/*
.DS_Store

# Project files
.ropeproject
.project
.pydevproject
.settings
.idea
.vscode
tags

# Package files
*.egg
*.eggs/
.installed.cfg
*.egg-info
integration-tests/*
docs/build/*

# Unittest and coverage
htmlcov/*
.coverage
.coverage.*
.tox
junit*.xml
coverage.xml
.pytest_cache/

# Build and docs folder/files
build/*
dist/*
sdist/*
docs/api/*
docs/_rst/*
docs/_build/*
cover/*
MANIFEST

# Per-project virtualenvs
.venv*/
.conda*/
.python-version
tool_library/OT2_pipette/designs/OT_post_base.3mf
3 changes: 3 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[settings]
profile = black
known_first_party = science_jubilee
69 changes: 69 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
exclude: '^docs/conf.py'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
args: ['--maxkb=5000']
# exclude: ^(docs/_static/robot-loop.gif)$
- id: check-ast
# - id: check-json
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: mixed-line-ending
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows

## If you want to automatically "modernize" your Python code:
# - repo: https://github.com/asottile/pyupgrade
# rev: v3.7.0
# hooks:
# - id: pyupgrade
# args: ['--py37-plus']

## If you want to avoid flake8 errors due to unused vars or imports:
# - repo: https://github.com/PyCQA/autoflake
# rev: v2.1.1
# hooks:
# - id: autoflake
# args: [
# --in-place,
# --remove-all-unused-imports,
# --remove-unused-variables,
# ]

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black
language_version: python3

## If like to embrace black styles even in the docs:
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.13.0
# hooks:
# - id: blacken-docs
# additional_dependencies: [black]

# - repo: https://github.com/PyCQA/flake8
# rev: 7.0.0
# hooks:
# - id: flake8
# ## You can add flake8 plugins via `additional_dependencies`:
# # additional_dependencies: [flake8-bugbear]

## Check for misspells in documentation files:
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.5
# hooks:
# - id: codespell
Loading
Loading