From cb6623c57c68c6689abccfbed633975e0fc5bac6 Mon Sep 17 00:00:00 2001 From: Reece Hart Date: Fri, 8 Sep 2023 22:23:04 -0700 Subject: [PATCH 1/5] use make develop to install in github actions --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b4b4966..956af6c 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -63,7 +63,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install --use-deprecated=legacy-resolver -e .[test] + make develop - name: Test with pytest run: | From db3bf591836b7ebe4bfba103cf73a1ee00cde59e Mon Sep 17 00:00:00 2001 From: Reece Hart Date: Sat, 9 Sep 2023 07:10:18 -0700 Subject: [PATCH 2/5] #2: removing deepsource due to recurring config issues --- .deepsource.toml | 10 ---------- .github/workflows/python-package.yml | 10 ---------- 2 files changed, 20 deletions(-) delete mode 100644 .deepsource.toml diff --git a/.deepsource.toml b/.deepsource.toml deleted file mode 100644 index 4719a80..0000000 --- a/.deepsource.toml +++ /dev/null @@ -1,10 +0,0 @@ -version = 1 - -test_patterns = [ - 'tests/test_*.py' -] - -[[analyzers]] -name = 'python' -enabled = true -runtime_version = '3.x.x' diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 956af6c..0028ff5 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -68,16 +68,6 @@ jobs: - name: Test with pytest run: | make test - - - 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 - env: - DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} deploy: needs: From 31eac8966492e1ca41aa7b7b973702e57a813a98 Mon Sep 17 00:00:00 2001 From: Reece Hart Date: Sat, 9 Sep 2023 07:25:18 -0700 Subject: [PATCH 3/5] Drop Python 3.8 support --- .github/workflows/python-package.yml | 2 +- Makefile | 13 +++++++------ pyproject.toml | 2 +- setup.cfg | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0028ff5..4f045b1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -48,7 +48,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 diff --git a/Makefile b/Makefile index 3b575f4..508075b 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,8 @@ SHELL:=/bin/bash -e -o pipefail -O globstar SELF:=$(firstword $(MAKEFILE_LIST)) +VE_DIR=venv + TEST_DIRS:=tests DOC_TESTS:=src ./README.md @@ -27,17 +29,16 @@ help: #=> devready: create venv, install prerequisites, install pkg in develop mode .PHONY: devready devready: - make venv && source venv/bin/activate && make develop + make ${VE_DIR} && source ${VE_DIR}/bin/activate && make develop @echo '#################################################################################' - @echo '### Do not forget to `source venv/bin/activate` to use this environment ###' + @echo '### Do not forget to `source ${VE_DIR}/bin/activate` to use this environment ###' @echo '#################################################################################' #=> venv: make a Python 3 virtual environment -.PHONY: venv -venv: +${VE_DIR}: python3 -mvenv $@; \ source $@/bin/activate; \ - python -m ensurepip --upgrade; \ + python3 -m ensurepip --upgrade; \ pip install --upgrade pip setuptools wheel #=> develop: install package in develop mode @@ -128,7 +129,7 @@ cleaner: clean #=> cleanest: remove files and directories that require more time/network fetches to rebuild .PHONY: cleanest cleanest: cleaner - rm -fr .eggs .tox venv + rm -frv .eggs .tox venv #=> distclean: remove untracked files and other detritus .PHONY: distclean diff --git a/pyproject.toml b/pyproject.toml index 89a0e64..99d3ed1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ markers = [ [tool.coverage.run] branch = true source = ["biocommons.example"] -omit = ["*_test.py", "*/tests/*"] +omit = ["*_test.py", "*/test/*", "*/tests/*"] [tool.coverage.report] diff --git a/setup.cfg b/setup.cfg index 8bd46b4..09741cf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,7 +23,7 @@ dev = isort~=5.10 mypy pylint~=2.14 - pytest-cov~=4.0 + pytest-cov~=4.1 pytest-optional-tests pytest~=7.1 tox~=3.25 @@ -42,7 +42,7 @@ exclude = [flake8] ignore = E129,E133,E203,E221,E241,E251,E303,E266,H106,H904,W291 -max-line-length = 120 +max-line-length = 100 max-complexity = 15 hang-closing = true exclude = From ed2baffddd0f5069bcb607365ca5d99aeed60f24 Mon Sep 17 00:00:00 2001 From: Reece Hart Date: Sat, 9 Sep 2023 08:43:39 -0700 Subject: [PATCH 4/5] Close #23: Add config for stale issues and PRs --- .github/workflows/stale.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..4f6b2e8 --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,24 @@ +# https://github.com/actions/stale + +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '1 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v8 + with: + days-before-issue-stale: 30 + days-before-issue-close: 7 + stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.' + close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.' + + days-before-pr-stale: 30 + days-before-pr-close: 7 + stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.' + close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.' + + exempt-all-pr-assignees: true \ No newline at end of file From f8e86ff7d8200fa0af1d5fc4187bf828d8a5a2e8 Mon Sep 17 00:00:00 2001 From: Reece Hart Date: Sat, 16 Sep 2023 22:32:42 -0700 Subject: [PATCH 5/5] reformatted with black and isort --- pyproject.toml | 12 ++++++------ setup.cfg | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 99d3ed1..fcc19d2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,20 +6,20 @@ authors = [ description = "Example Package" readme = "README.md" license = { file="LICENSE.txt" } -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] dynamic = ["version"] [project.urls] -"Homepage" = "https://github.com/biocommons/example" -"Bug Tracker" = "https://github.com/biocommons/exmaple/issues" +"Homepage" = "https://github.com/biocommons/biocommons.example" +"Bug Tracker" = "https://github.com/biocommons/biocommons.example/issues" [build-system] @@ -74,7 +74,7 @@ exclude_lines = [ ] [tool.black] -line-length = 120 +line-length = 100 # [tool.flake8] @@ -87,4 +87,4 @@ disable = "R0913" [tool.pylint.format] -max-line-length = "120" +max-line-length = 100 diff --git a/setup.cfg b/setup.cfg index 09741cf..9817ed5 100644 --- a/setup.cfg +++ b/setup.cfg @@ -9,10 +9,6 @@ install_requires = coloredlogs~=15.0 pyyaml~=6.0 -[options.entry_points] -console_scripts = - marvin-quote = biocommons.example.__main__:main - [options.extras_require] dev = bandit~=1.7 @@ -31,6 +27,10 @@ dev = docs = mkdocs +[options.entry_points] +console_scripts = + marvin-quote = biocommons.example.__main__:main + [options.packages.find] where = src exclude =