Skip to content

Commit fa668fb

Browse files
committed
Generated new targets, setup.py version changes
Signed-off-by: Saif Ul Islam <[email protected]>
1 parent bbecacb commit fa668fb

File tree

2 files changed

+78
-15
lines changed

2 files changed

+78
-15
lines changed

Makefile

Lines changed: 77 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,78 @@ def skip(app, what, name, obj,would_skip, options):
1515
extensions.append('sphinx_autodoc_typehints')
1616
endef
1717

18+
# SETUP
19+
20+
# # Setup all
21+
setup: setup-prod setup-dev
22+
23+
# # Install needed dependencies
24+
setup-prod:
25+
python -m pip install --upgrade pip
26+
pip install pipenv
27+
pipenv install
28+
29+
# # Install developer dependencies
30+
setup-dev:
31+
python -m pip install --upgrade pip
32+
pip install pipenv
33+
pipenv install --dev
34+
35+
# PACKAGE BUILD
36+
37+
# # Build the package
38+
build:
39+
# Builds the package distributions
40+
python3 setup.py sdist bdist_wheel --universal
41+
42+
local-install:
43+
# Locally install mapillary - DO THIS ONLY AFTER RUNNING `make build`
44+
pip3 install -e .
45+
46+
# CODE QUALITY
47+
48+
# # Styling related
1849
style: format lint
1950

51+
# # # Formatting
2052
format:
21-
black src/mapillary
53+
@ black src/mapillary
2254

55+
# # # Linting
2356
lint:
24-
# stop the build if there are Python syntax errors or undefined names
25-
flake8 src/mapillary --count --select=E9,F63,F7,F82 --show-source --statistics
57+
@ # stop the build if there are Python syntax errors or undefined names
58+
@ flake8 src/mapillary --count --select=E9,F63,F7,F82 --show-source --statistics
59+
60+
@ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
61+
@ flake8 src/mapillary --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
2662

27-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
28-
flake8 src/mapillary --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
63+
# DOCUMENTATION
2964

30-
sphinx-docs:
65+
# # For generating the latest developer documentation from src/mapillary
66+
# # and serving them locally with Docusaurus
67+
docs-gen: docs-sphinx docs-py docs-start
68+
69+
# # # Sphinx Documentation Generation
70+
docs-sphinx:
3171
sphinx-apidoc -o sphinx-docs ./src/ sphinx-apidoc --full -A 'Mapillary'; cd sphinx-docs; echo "$$PYTHON_SCRIPT" >> conf.py; make markdown;
3272

33-
sphinx-docs-clean:
34-
rm -rf sphinx-docs/
73+
# # # Python Script for moving markdown from sphinx -> docusaurus
74+
docs-py:
75+
python3 scripts/documentation.py
76+
77+
# # # Serve the newly generated documentation
78+
docs-start:
79+
cd docs; npm run start;
3580

36-
docs: docs-build docs-deploy
81+
# # For pushing the docs to the gh-pages branch
82+
docs-push: docs-build docs-deploy
3783

84+
# # # Building the static pages
85+
docs-build:
86+
# Building the documentation
87+
cd docs; npm run build;
88+
89+
# # # Deploying the documentation to gh-pages
3890
docs-deploy:
3991
# Deploying the documentation
4092
# Deploying requires GIT_USER's password and write access to the repository
@@ -44,14 +96,25 @@ docs-deploy:
4496
# https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/
4597
cd docs; GIT_USER=Rubix982 yarn deploy;
4698

47-
docs-build:
48-
# Building the documentation
49-
cd docs; npm run build;
99+
# CLEANING
100+
101+
# # Removing temporary created artifacts
102+
clean: sphinx-docs-clean docs-clean build-clean
50103

104+
# # # Remove Sphinx Documentation
105+
sphinx-docs-clean:
106+
rm -rf sphinx-docs/
107+
108+
# # # Remove latest build of docs
51109
docs-clean:
52110
rm -rf docs/build
53111

112+
# # # Remove latest sr/mapillary build
113+
build-clean:
114+
rm -rf build/ dist/
115+
116+
# TESTING
117+
118+
# # Execute pytest on tests/
54119
test:
55120
@ pytest --log-cli-level=20
56-
57-
clean: sphinx-docs-clean docs-clean

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1. https://packaging.python.org/tutorials/packaging-projects/
1111
2. https://www.youtube.com/watch?v=GIF3LaRqgXo
1212
13-
:copyight: (c) 2021 Facebook
13+
:copyright: (c) 2021 Facebook
1414
:license: MIT LICENSE
1515
"""
1616

0 commit comments

Comments
 (0)