Skip to content

Commit

Permalink
Remove CI scripts from Makefile, Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
bonicim committed May 18, 2024
1 parent 89299d8 commit 69a610f
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 113 deletions.
81 changes: 18 additions & 63 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PYTHON3 = python3

############# Manage Environments #############

## Environment using Pip
## Create environment using Pip
.PHONY: venv
venv: clean-venv
@$(PYTHON3) -m venv $(VENV);
Expand All @@ -19,19 +19,28 @@ install:
@$(PYTHON3) -m pip install -e .
@$(PYTHON3) -m pip install -r requirements.txt

## Environment using Poetry
## Create environment using Poetry

.PHONY: develop
develop: clean-poetry-env
poetry shell
.PHONY: install-with-poetry
install-with-poetry:
poetry env remove --all
poetry install --with test


## Create new requirements.txt from current poetry environment
.PHONY: requirements.txt
requirements.txt:
poetry export --format requirements.txt --output requirements.txt --without-hashes --with test,widget,tutorials,docs

############# Running Tests, linters #############
############# Tutorials #############
.PHONY: tutorials
tutorials:
jupyter notebook tutorials

.PHONY: clean
clean:
rm -rf .out .pytest_cache .tox *.egg-info dist build _build pytest.xml pytest_notebooks.xml .coverage

############# Running Tests, linters, formatters #############

## Tests
.PHONY: test
Expand All @@ -45,37 +54,12 @@ test-core:
coverage report -m


## Tests using Tox
## Run test on Tox framework
## Includes linting, running tests on jupyter notebooks
.PHONY: test-tox
test-tox:
@$(PYTHON3) -m tox --parallel

### Tests using Poetry + Tox
### Used by Bamboo CI Pipeline, Github Workflows CI Pipeline

.PHONY: test-ci-stash
test-ci-stash: install-poetry-stash run-poetry-tox clean-poetry-env

.PHONY: build-docs-stash
build-docs-stash: install-poetry-stash run-build-docs clean-poetry-env

.PHONY: install-poetry-stash
install-poetry-stash:
pip install poetry==1.8.2 tox

.PHONY: run-poetry-tox
run-poetry-tox:
tox --parallel

.PHONY: run-build-docs
run-build-docs:
tox -e build-docs

.PHONY: clean-poetry-env
clean-poetry-env:
poetry env remove --all

## Lint
.PHONY: lint
lint: pylint flake8
Expand All @@ -89,37 +73,8 @@ pylint:
flake8:
@$(PYTHON3) -m flake8 hypernetx --exit-zero

## precommit hooks that include formatter (Black)
.PHONY: pre-commit
pre-commit:
pre-commit install
pre-commit run --all-files

############# Packaging and Publishing to PyPi #############
## Uses Poetry to manage packaging and publishing
## Targets are included as a backup in case the Github Workflows CI can't publish to PyPi and we need to do it manually
## Assumes the following environment variables are set: PYPI_API_TOKEN
.PHONY: publish-to-pypi
publish-to-pypi: build check-long-desc
@echo "Publishing to PyPi"
poetry config pypi-token.pypi PYPI_API_TOKEN
poetry config repositories.pypi https://pypi.org/simple/
poetry publish --dry-run
#poetry publish

.PHONY: build
build: clean
poetry build

.PHONY: check-long-desc
check-long-desc:
poetry run pip install twine
poetry run twine check dist/*

############# Misc #############
.PHONY: tutorials
tutorials:
jupyter notebook tutorials

.PHONY: clean
clean:
rm -rf .out .pytest_cache .tox *.egg-info dist build _build pytest.xml pytest_notebooks.xml .coverage
88 changes: 38 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,37 +72,37 @@ Google Colab
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
<span >Basic 1 - HNX Basics</span>
</a>
</br>
<br>

<a href="https://colab.research.google.com/github/pnnl/HyperNetX/blob/master/tutorials/basic/Basic%202%20-%20Visualization%20Methods.ipynb" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
<span >Basic 2 - Visualization Methods</span>
</a>
</br>
<br>

<a href="https://colab.research.google.com/github/pnnl/HyperNetX/blob/master/tutorials/basic/Basic%203%20-%20LesMis%20Case%20Study.ipynb" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
<span >Basic 3 - LesMis Case Study</span>
</a>
</br>
<br>

<a href="https://colab.research.google.com/github/pnnl/HyperNetX/blob/master/tutorials/basic/Basic%204%20-%20LesMis%20Visualizations-BookTour.ipynb" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
<span >Basic 4 - LesMis Visualizations-Book Tour</span>
</a>
</br>
<br>

<a href="https://colab.research.google.com/github/pnnl/HyperNetX/blob/master/tutorials/basic/Basic%205%20-%20HNX%20attributed%20hypergraph.ipynb" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
<span >Basic 5 - HNX attributed hypergraph</span>
</a>
</br>
<br>

<a href="https://colab.research.google.com/github/pnnl/HyperNetX/blob/master/tutorials/basic/Basic%206%20-%20Hypergraph%20Arithmetic.ipynb" target="_blank">
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
<span >Basic 6 - Hypergraph Arithmetic.ipynb</span>
</a>
</br>
<br>


Jupyter Notebooks
Expand All @@ -115,7 +115,7 @@ Installation

The recommended installation method for most users is to create a virtual environment and install HyperNetX from PyPi.

HyperNetX may be cloned or forked from [Github](https://github.com/pnnl/HyperNetX).
HyperNetX may be cloned or forked from [GitHub](https://github.com/pnnl/HyperNetX).

Prerequisites
-------------
Expand Down Expand Up @@ -168,7 +168,7 @@ To deactivate your environment, use:
Installing HyperNetX
====================

Regardless of how you install HyperNetX, ensure that your environment is activated and that you are running Python >=3.8.
Regardless of how you install HyperNetX, ensure that your environment is activated and that you are running Python >=3.10.


Installing from PyPi
Expand Down Expand Up @@ -261,6 +261,9 @@ Install support for testing
```shell
poetry install --with test

# activate your virtual environment created by poetry
poetry shell

# run tests
python -m pytest

Expand All @@ -275,9 +278,12 @@ open htmlcov/index.html
Install support for tutorials
-----------------------------

```
```shell
poetry install --with tutorials

# activate your virtual environment created by poetry
poetry shell

# open Jupyter notebooks in a browser
make tutorials
```
Expand All @@ -291,8 +297,10 @@ HyperNetX uses a number of tools to maintain code quality:

Before using these tools, ensure that you install Pylint in your environment:

```
```shell
poetry install --with lint
# activate your virtual environment created by poetry
poetry shell
```

Pylint
Expand Down Expand Up @@ -325,13 +333,30 @@ Black
black hypernetx
```

Pre-commit
---------

Use the [pre-commit framework](https://pre-commit.com/) to automatically point out issues and resolve those issues before code review.
It is highly recommended to install pre-commit in your development environment so that issues with your code can be found before you submit a
pull request. More importantly, using pre-commit will automatically format your code changes so that they pass the CI build. For example, pre-commit will
automatically run the formatter Black on your code changes.

```shell
pre-commit install

# Once installed, pre-commit will be triggered every time you make a commit in your environment
```

Documentation
-------------

Build and view documentation locally:

```
```shell
poetry install --with docs
# activate your virtual environment created by poetry
poetry shell

cd docs
make html
open docs/build/html/index.html
Expand All @@ -340,7 +365,7 @@ open docs/build/html/index.html
When editing documentation, you can auto-rebuild the documentation locally so that you can view your document changes
live on the browser without having to rebuild every time you have a change.

```
```shell
cd docs
make livehtml
```
Expand All @@ -360,49 +385,12 @@ Click on `http://127.0.0.1:8000/install.html` to open the docs on your browser.
you change a document file, it will automatically render on your browser, allowing you to verify your document changes.


Continuous Integration
======================

This project runs Continuous Integration (CI) using GitHub Actions. Normally, CI runs
on pull requests, pushes to certain branches, and other events.

Maintainers of the GitHub repository can manually trigger CI using [GitHub CLI](https://cli.github.com/). See instructions below on how to manually trigger CI on GitHub Actions:

```commandline
# login to Github
gh auth login --with-token < ~/.ssh/tokens/<path to my personal access token>
# Trigger CI
gh workflow run ci.yml --repo pnnl/HyperNetX --ref <name of branch that you want CI to run on> --field triggeredBy="<Your name>"
# Get the status of the workflow
gh run list --workflow=ci.yml --repo pnnl/HyperNetX
```


Versioning
==========

This project uses [`commitizen`](https://github.com/commitizen-tools/commitizen) to manage versioning.
The files where "version" will be updated are listed in the '.cz.toml' file. To create a new version and the associated tag,
run the following commands:

```shell
# Install commitizen tool to environment
pip install commitizen

# Updates version; values for '--increment' can be MAJOR, MINOR, or PATCH
# Autocreates a tag and commit for the updated version
cz bump --increment MAJOR --dry-run
cz bump --increment MAJOR
```

Notice
======
This material was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Battelle, nor any of their employees, nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe privately owned rights.
Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof, or Battelle Memorial Institute. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.

<div align=center>
<div>
<pre style="align-text:center;font-size:10pt">
PACIFIC NORTHWEST NATIONAL LABORATORY
operated by
Expand Down

0 comments on commit 69a610f

Please sign in to comment.