Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add package build doc #32

Merged
merged 5 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions docs/DEVELOPER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Instructions for packaging ConStrain package locally with Poetry

ConStrain can be made a pip-able Python package using `poetry`. Here's a quick guide to go about creating the package, installing it, and testing it.

## Install `poetry`
```
curl -sSL https://install.python-poetry.org | python3 -
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also add instructions for Windows? Or at least specify that this is for Unix?

```
## Build `constrain` using `poetry`
From the root of the repository:
```
poetry build
```
## Install the package
From the root of the repository:
```
pip install .\dist\constrain-0.3.1-py3-none-any.whl
```
## Testing the package on one of the example scripts
```
python .\demo\G36_demo\g36_demo_workflow_runner.py
```
Should output something similar to the following:
```
[...]
Running state 12: [Success] ... Congratulations! the demo workflow is executed with expected results and no error!
Done. -- [22:19:51]
Workflow done at 22:19:51, a total of 12 states were executed in 0:00:33.789468.
```
## Run tests locally
```
poetry run pytest tests
```

# Publish ConStrain to Pypi

`poetry build` then `poetry publish`

# Build the Documentation locally

- Install sphinx: `pip install sphinx==7.3.7`
- Build documentation: `poetry run sphinx-build .\docs\source\ .\docs\`

This will create all the `*.html` files in the `.\docs` folder.
Comment on lines +39 to +44
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added instruction on how to build the documentation since I've been working on updating it.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ConStrain"
version = "0.3.2"
version = "0.4.0"
description = "ConStrain is a data-driven knowledge-integrated framework that automatically verifies that building system controls function as intended."
authors = ["Lei, Xuechen <[email protected]>", "Chen, Yan <[email protected]>", "Lerond, Jeremy <[email protected]>", "Jung, Yun Joon <[email protected]>"]
readme = "README.md"
Expand Down
Loading