Skip to content

Commit

Permalink
Add simplified makefile, development instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Jun 13, 2023
1 parent 91c5653 commit 92c75b3
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 3 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ History

.. to_doc
------------------
0.1.1 (12-06-2023)
------------------
* Add simplified makefile, development instruction
* Fix project description

------------------
0.1.0 (12-06-2023)
------------------
Expand Down
53 changes: 53 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Location of virtualenv used for development.
VENV?=.venv
IN_VENV=if [ -f $(VENV)/bin/activate ]; then . $(VENV)/bin/activate; fi;
UPSTREAM?=galaxyproject
SOURCE_DIR?=galaxy-release-util
PROJECT_URL?=https://github.com/galaxyproject/galaxy-release-util
PROJECT_NAME?=galaxy-release-util
TEST_DIR?=tests
# Open resource on Mac OS X or Linux
OPEN_RESOURCE=bash -c 'open $$0 || xdg-open $$0'

.PHONY: clean-pyc clean-build docs clean

help:
@egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr *.egg-info

clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/

setup-venv: ## setup a development virtualenv in current directory
if [ ! -d $(VENV) ]; then virtualenv $(VENV); exit; fi;
$(IN_VENV) pip install -r dev-requirements.txt
$(IN_VENV) pip install -e .

lint: ## check style using tox and flake8 for Python 2 and Python 3
$(IN_VENV) tox -e lint

test: ## run tests with the default Python (faster than tox)
$(IN_VENV) tox -e unit

open-history: # view HISTORY.rst as HTML.
rst2html.py HISTORY.rst > /tmp/galaxy_release_util_history.html
$(OPEN_RESOURCE) /tmp/galaxy_release_util_history.html

dist: clean ## create and check packages
$(IN_VENV) python -m build
$(IN_VENV) twine check dist/*
ls -l dist
15 changes: 14 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ Overview

Scripts to create new Galaxy_ releases.

* Code: https://github.com/galaxyproject/galaxy
* Code: https://github.com/galaxyproject/galaxy-release-util

.. _Galaxy: http://galaxyproject.org/

Development
-----------

Tests can be executed with `tox`.

Release Checklist
-----------------

* Update HISTORY.rst
* Update version number in setup.cfg
* Run `make dist`
* Tag a new version and create a release from the GitHub interface
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ long_description = file: README.rst, HISTORY.rst
long_description_content_type = text/x-rst
name = galaxy-release-util
url = https://github.com/galaxyproject/galaxy-release-util
version = 0.1.0
version = 0.1.1

[options]
include_package_data = True
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ python =

[testenv]
commands =
lint: flake8 --ignore E203,E501,D,W503 --max-line-length 120
lint: flake8 --ignore E203,E501,D,W503 --max-line-length 120 --exclude .tox,.venv,build,dist,.git .
lint: black --check --diff .
lint: ruff .
unit: pytest {env:PYTEST_FAIL_FAIL:} {env:PYTEST_CAPTURE:} -m {env:PYTEST_MARK:""} {env:PYTEST_TARGET:{[tox]test_dir}} {posargs}
Expand Down

0 comments on commit 92c75b3

Please sign in to comment.