Skip to content

Commit 980166d

Browse files
wuweicaifbdbeylkin
andcommitted
Initial commit
Co-authored-by: Daniel Beylkin <dbeylkin@fb.com> Co-authored-by: Wenteng Ma Co-authored-by: Zhiqian Deng
0 parents  commit 980166d

File tree

291 files changed

+82626
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+82626
-0
lines changed

.coverage

92 KB
Binary file not shown.

.flake8

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[flake8]
2+
select = B,C,E,F,P,T4,W,B9
3+
max-line-length = 80
4+
# E127, E128 are hard to silence in certain nested formatting situations.
5+
# E265, E266 talk about comment formatting which is too opinionated.
6+
# E402 warns on imports coming after statements. There are important use cases
7+
# before imports.
8+
# E501 is not flexible enough, we're using B950 instead.
9+
# E722 is a duplicate of B001.
10+
# P207 is a duplicate of B003.
11+
# W503 talks about operator formatting which is too opinionated.
12+
# E203 conflicts with Black
13+
ignore = E127, E128, E265, E266, E402, E501, E722, P207, W503, E203, T484
14+
max-complexity = 50
15+
exclude =
16+
.git,
17+
.hg,
18+
.tox,
19+
__init__.py
20+
__pycache__,
21+
_bin/*,
22+
_build/*,

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug
3+
about: Use this template for bugs.
4+
title: "[BUG NAME] - "
5+
labels: bug
6+
assignees:
7+
---
8+
9+
This issue tracker is **ONLY** used for reporting bugs.
10+
11+
<!--- Provide a general summary of the issue in the Title above -->
12+
13+
## Expected Behavior
14+
<!--- Tell us what should happen -->
15+
16+
## Current Behavior
17+
<!--- Tell us what happens instead of the expected behavior -->
18+
19+
## Steps to Reproduce
20+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
21+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
22+
1.
23+
2.
24+
3.
25+
4.
26+
27+
## Context
28+
<!--- What are you trying to accomplish? How has this issue affected you? -->
29+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
30+
31+
## Detailed Description
32+
<!--- Provide a detailed description of the change or addition you are proposing -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!--
2+
Thank you for submitting a Pull Request!
3+
Please carefully follow the instructions below.
4+
-->
5+
6+
## Prerequisites
7+
8+
- [ ] I have read the [Contributing Guidelines](../blob/main/CONTRIBUTING.md).
9+
- [ ] I have read the [Code of Conduct](../blob/main/CODE_OF_CONDUCT.md).
10+
- [ ] If this is a non-trivial change, I have already opened an accompanying Issue.
11+
- [ ] If applicable, I have included documentation updates alongside my code changes.
12+
13+
<!--
14+
Please remember to sign the CLA, although you can also sign it after submitting this Pull Request.
15+
The CLA is required for us to merge your Pull Request.
16+
-->
17+
18+
## Description
19+
20+
<!--
21+
Describe your changes, or link to another Issue or Pull Request.
22+
-->
23+
24+
## Test Plan
25+
26+
<!--
27+
Describe how you have tested your changes.
28+
Please include relevant environment details, logs, screenshots, etc.
29+
Do not provide customer information that could be considered personally identifiable information (PII).
30+
-->
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
name: Deploy to GitHub Pages
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: docusaurus
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: '>=16.14'
20+
cache: yarn
21+
cache-dependency-path: docusaurus/yarn.lock
22+
23+
- name: Install dependencies
24+
run: yarn install --frozen-lockfile
25+
- name: Build website
26+
run: yarn build
27+
- name: Deploy to GitHub Pages
28+
uses: peaceiris/actions-gh-pages@v3
29+
with:
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
publish_dir: ./docusaurus/build
32+
# The following lines assign commit authorship to the official
33+
# GH-Actions bot for deploys to `gh-pages` branch:
34+
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
35+
# The GH actions bot is used by default if you didn't specify the two fields.
36+
# You can swap them out with your own user credentials.
37+
user_name: github-actions[bot]
38+
user_email: 41898282+github-actions[bot]@users.noreply.github.com
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Internal use for the private repository owned by Meta only.
2+
# Delete tests except Sample right before release
3+
name: Integration Test
4+
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
branches:
10+
- '*'
11+
12+
jobs:
13+
Integration_test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
20+
- name: Install Packages
21+
run: |
22+
sudo apt update
23+
sudo apt install -y python3-pip
24+
sudo apt install -y gdal-bin
25+
sudo apt install -y libgdal-dev
26+
export CPLUS_INCLUDE_PATH=/usr/include/gdal
27+
export C_INCLUDE_PATH=/usr/include/gdal
28+
pip3 install .
29+
30+
- name: Run Sample
31+
run: |
32+
python3 -c "import terragraph_planner; \
33+
terragraph_planner.optimize_and_report_topology_with_config_file('terragraph_planner/data/sample_plan/config.yaml')"

.github/workflows/lint.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Lint
2+
3+
on:
4+
# Trigger the workflow on push or pull request,
5+
# but only for the main branch
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches:
10+
- "*"
11+
12+
jobs:
13+
Linters:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: [3.8]
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install Dependencies
29+
run: |
30+
pip install -r requirements_dev.txt
31+
pre-commit install
32+
33+
- name: Lint
34+
run: pre-commit run --all-files

.github/workflows/pyre.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Pyre
2+
3+
on:
4+
# Trigger the workflow on push or pull request,
5+
# but only for the main branch
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches:
10+
- "*"
11+
12+
jobs:
13+
Linters:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: [3.8]
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install Dependencies
29+
run: |
30+
sudo apt update
31+
sudo apt install -y gdal-bin
32+
sudo apt install -y libgdal-dev
33+
export CPLUS_INCLUDE_PATH=/usr/include/gdal
34+
export C_INCLUDE_PATH=/usr/include/gdal
35+
pip install -r requirements.txt
36+
pip install -r requirements_dev.txt
37+
pip install cython flask flask_cors graphql-core typing_inspect
38+
VERSION=$(grep "version" .pyre_configuration | sed -n -e 's/.*\(0\.0\.[0-9]*\).*/\1/p')
39+
pip install pyre-check-nightly==$VERSION
40+
41+
- name: Run Pyre
42+
run: pyre

.github/workflows/unittest.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Unittest
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches:
8+
- '*'
9+
10+
jobs:
11+
Unittest:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Install Packages
19+
run: |
20+
sudo apt update
21+
sudo apt install -y gdal-bin
22+
sudo apt install -y libgdal-dev
23+
export CPLUS_INCLUDE_PATH=/usr/include/gdal
24+
export C_INCLUDE_PATH=/usr/include/gdal
25+
pip install .
26+
27+
- name: Run All Unittest
28+
run: python -m unittest discover terragraph_planner -b

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
*.ddl
7+
8+
# Files generate by setup.py
9+
dist/
10+
build/
11+
terragraph_planner.egg-info/
12+
.eggs/
13+
14+
# VS code
15+
.vscode/
16+
17+
# pyre
18+
.pyre
19+
20+
# Mac OS X
21+
**/.DS_Store
22+
23+
# Pyre
24+
.pyre/

0 commit comments

Comments
 (0)