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

kicking off #20 - modernizing fastpairs #24

Merged
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
67 changes: 67 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Continuous Integration

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
schedule:
- cron: '59 23 * * *'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the cron here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run nightly CI on main.

workflow_dispatch:
inputs:
version:
description: Manual CI Run
default: test
required: false

jobs:
tests:
name: ${{ matrix.os }}, ${{ matrix.environment-file }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest]
environment-file: [
ci/py312-latest.yaml,
]
fail-fast: false

defaults:
run:
shell: bash -l {0}

steps:
- name: checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ matrix.environment-file }}
micromamba-version: "latest"

- name: install package
run: "pip install -e ."

- name: environment info
run: "micromamba info && micromamba list"

- name: run tests
run: |
pytest \
fastpair/ \
--verbose \
-r a \
--color yes \
--cov fastpair \
--cov-append \
--cov-report term-missing \
--cov-report xml .

- name: codecov
uses: codecov/codecov-action@v4
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ ENV/

# Rope project settings
.ropeproject

# macOS
*.DS_Store
10 changes: 10 additions & 0 deletions ci/py312-latest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: py312-latest
channels:
- conda-forge
- nodefaults
dependencies:
- python=3.12
- scipy=1.11
# testing
- pytest
- pytest-cov
30 changes: 1 addition & 29 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,7 @@

PACKAGE_NAME = "FastPair"
DESCRIPTION = "FastPair: Data-structure for the dynamic closest-pair problem."

MAJOR = 0
MINOR = 1
MICRO = 0
ISRELEASED = False
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
QUALIFIER = ''
FULLVERSION = VERSION
if not ISRELEASED:
FULLVERSION += '.dev'
try:
import subprocess
try:
pipe = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"],
stdout=subprocess.PIPE).stdout
except OSError:
# msysgit compatibility
pipe = subprocess.Popen(
["git.cmd", "describe", "HEAD"],
stdout=subprocess.PIPE).stdout
rev = pipe.read().strip()
# Makes distutils blow up on Python 2.7
if sys.version_info[0] >= 3:
rev = rev.decode('ascii')
FULLVERSION = '%d.%d.%d.dev-%s' % (MAJOR, MINOR, MICRO, rev)
except:
warnings.warn("Couldn't get git revision")
else:
FULLVERSION += QUALIFIER
FULLVERSION = "v0.1.0"

setup(name=PACKAGE_NAME, version=FULLVERSION, description=DESCRIPTION,
license='MIT', author='Carson J. Q. Farmer',
Expand Down