-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from SwamyDev/master
Removes pyscaffold and updates readme with new development environment instructions and examples
- Loading branch information
Showing
26 changed files
with
423 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Formatting and Snippets | ||
on: | ||
push: | ||
jobs: | ||
format_and_snippets: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run MarkdownSnippets | ||
run: | | ||
dotnet tool install --global MarkdownSnippets.Tool | ||
mdsnippets ${GITHUB_WORKSPACE} | ||
shell: bash | ||
- name: Git Commit and Push | ||
uses: github-actions-x/commit@v2.9 | ||
with: | ||
github-token: "${secrets.GITHUB_TOKEN}" | ||
commit-message: "d updated markdown snippets" | ||
rebase: 'true' | ||
push-branch: 'master' | ||
name: github actions | ||
email: actions@github.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,5 @@ cover/* | |
MANIFEST | ||
/Equi7Grid.egg-info/ | ||
/equi7grid/Equi7Grid_old.py | ||
|
||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
.ONESHELL: | ||
SHELL = /bin/bash | ||
|
||
.PHONY: help clean environment install test version dist | ||
|
||
CONDA_ENV_DIR = $(shell conda info --base)/envs/equi7grid | ||
CONDA_ACTIVATE = source $$(conda info --base)/etc/profile.d/conda.sh ; conda activate ; conda activate | ||
TEST_ENV = | ||
|
||
help: | ||
@echo "make clean" | ||
@echo " clean all python build/compilation files and directories" | ||
@echo "make venv" | ||
@echo " create the base virtualenv environment for the project" | ||
@echo "make conda" | ||
@echo " create the base conda environment for the project" | ||
@echo "make test" | ||
@echo " run test with coverage" | ||
@echo "make version" | ||
@echo " update _version.py with current version tag" | ||
@echo "make dist" | ||
@echo " build the package ready for distribution and update the version tag" | ||
|
||
clean: | ||
find . -name '*.pyc' -exec rm --force {} + | ||
find . -name '*.pyo' -exec rm --force {} + | ||
find . -name '*~' -exec rm --force {} + | ||
rm --force .coverage | ||
rm --force --recursive .pytest_cache | ||
rm --force --recursive build/ | ||
rm --force --recursive dist/ | ||
rm --force --recursive *.egg-info | ||
|
||
$(CONDA_ENV_DIR): | ||
@echo "creating new base equi7grid conda environment..." | ||
conda create -y -c conda-forge -n equi7grid python=3.10 pip mamba | ||
$(CONDA_ACTIVATE) equi7grid | ||
mamba install -y -c conda-forge gdal numpy scipy | ||
if [ $(TEST_ENV) ]; then pip install -e .[testing]; else pip install -e .; fi | ||
@echo "... finished." | ||
|
||
conda: $(CONDA_ENV_DIR) | ||
@echo -e "conda environment is ready. To activate use:\n\tconda activate equi7grid" | ||
|
||
venv/bin/activate: | ||
@echo "creating new base equi7grid virtualenv environment..." | ||
python3 -m venv venv | ||
source venv/bin/activate; pip install pygdal=="$(shell gdal-config --version).*"; if [ $(TEST_ENV) ]; then pip install -e .[testing]; else pip install -e .; fi | ||
@echo "... finished." | ||
|
||
venv: venv/bin/activate | ||
@echo -e "virtualenv environment is ready. To activate use:\n\tsource venv/bin/activate" | ||
|
||
test: | ||
pytest -rsx --verbose --color=yes --cov=equi7grid --cov-report term-missing | ||
|
||
version: | ||
echo -e "__version__ = \"$(shell git describe --always --tags --abbrev=0)\"\n__commit__ = \"$(shell git rev-parse --short HEAD)\"" > src/equi7grid/_version.py | ||
|
||
dist: version | ||
pip3 install build twine | ||
python3 -m build | ||
|
Oops, something went wrong.