Skip to content

Commit

Permalink
Merge pull request #25 from biocommons/21-tidy-up-biocommons-example-…
Browse files Browse the repository at this point in the history
…before-updating-repos

update README and Makefile
  • Loading branch information
reece authored Sep 9, 2023
2 parents ff073ac + 0296b9c commit 4892cec
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 38 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ jobs:
run: |
make test
- name: Report test-coverage to DeepSource
run: |
# Install the CLI
curl https://deepsource.io/cli | sh
# #2: I get DEEPSOURCE_DSN not set (or) is empty despite seting. Giving up for now.
# - name: Report test-coverage to DeepSource
# run: |
# # Install the CLI
# curl https://deepsource.io/cli | sh

# Send the report to DeepSource
./bin/deepsource report --analyzer test-coverage --key python --value-file .coverage
# # Send the report to DeepSource
# ./bin/deepsource report --analyzer test-coverage --key python --value-file .coverage

deploy:
needs:
Expand All @@ -84,7 +85,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: hello world
- name: Environment
run: |
echo "::group::Environment info"
echo github.event_name = ${{ github.event_name }}
Expand Down
42 changes: 20 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
.PRECIOUS:
.SUFFIXES:

SHELL:=/bin/bash -e -o pipefail
SHELL:=/bin/bash -e -o pipefail -O globstar
SELF:=$(firstword $(MAKEFILE_LIST))

PY_VERSION:=3.10
VE_DIR=venv/${PY_VERSION}

TEST_DIRS:=tests
DOC_TESTS:=src ./README.md

Expand All @@ -30,26 +27,26 @@ help:
#=> devready: create venv, install prerequisites, install pkg in develop mode
.PHONY: devready
devready:
make ${VE_DIR} && source ${VE_DIR}/bin/activate && make develop
make venv && source venv/bin/activate && make develop
@echo '#################################################################################'
@echo '### Do not forget to `source ${VE_DIR}/bin/activate` to use this environment ###'
@echo '### Do not forget to `source venv/bin/activate` to use this environment ###'
@echo '#################################################################################'

#=> venv: make a Python 3 virtual environment
venv: ${VE_DIR}
${VE_DIR}: venv/%:
python$* -mvenv $@; \
.PHONY: venv
venv:
python3 -mvenv $@; \
source $@/bin/activate; \
python -m ensurepip --upgrade; \
pip install --upgrade pip setuptools wheel

#=> develop: install package in develop mode
.PHONY: develop install
.PHONY: develop
develop:
@if [ -z "$${VIRTUAL_ENV}" ]; then echo "Not in a virtual environment; see README.md" 1>&2; exit 1; fi
pip install -e .[dev,test]
pip install -e .[dev]

#=> install: install package
.PHONY: install
install:
pip install .

Expand All @@ -76,10 +73,12 @@ cqa:
.PHONY: test test-code test-docs
test:
pytest
test-code:
pytest src
test-docs:
pytest docs
test-code:
pytest src
test-%:
pytest -m '$*' src

#=> tox -- run all tox tests
tox:
Expand All @@ -102,12 +101,11 @@ reformat:
rename:
./sbin/rename-package

# #=> docs -- make sphinx docs
# .PHONY: docs
# docs: develop
# # RTD makes json. Build here to ensure that it works.
# make -C doc html json

#=> docs -- make sphinx docs
.PHONY: docs
docs: develop
# RTD makes json. Build here to ensure that it works.
make -C doc html json

############################################################################
#= CLEANUP
Expand All @@ -127,10 +125,10 @@ cleaner: clean
rm -frv **/*.orig
rm -frv **/*.rej

#=> cleanest: remove files and directories that are more expensive to rebuild
#=> cleanest: remove files and directories that require more time/network fetches to rebuild
.PHONY: cleanest
cleanest: cleaner
rm -frv .eggs .tox venv
rm -fr .eggs .tox venv

#=> distclean: remove untracked files and other detritus
.PHONY: distclean
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,3 @@ Try it:

* Quality tools: Code reformatting with black and isort
* GitHub Actions for testing and packaging

# To Do

* Docs (mkdocs w/mkdocstrings or sphinx)
* Dockerfile
* test only certain tags
* fixture example
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[project]
name = "biocommons.example"
authors = [
{ name="Bob the Builder", email="bob@nowhere.com" },
{ name="biocommons contributors", email="biocommons-dev@googlegroups.com" },
]
description = "Example Package"
readme = "README.md"
license = { file="LICENSE" }
license = { file="LICENSE.txt" }
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit 4892cec

Please sign in to comment.