Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
m4wh6k committed Oct 11, 2022
0 parents commit 0d3d135
Show file tree
Hide file tree
Showing 69 changed files with 6,020 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
__pycache__/
.boardwalk/
.boardwalkd/
.DS_store
.idea
.vscode/
*.egg-info/
build/
dist/
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## What and why?

## How was this tested?

## Checklist
[ ] Have you run `make test`?
[ ] Have you updated the VERSION file (if applicable)?
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
__pycache__/
.boardwalk/
.boardwalkd/
.DS_store
.idea
.vscode/
*.egg-info/
build/
dist/
48 changes: 48 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Contributing

## Bug Reports & Feature Requests
Bug reports and feature requests are really helpful. Head over to
[Issues](https://github.com/Backblaze/boardwalk/issues), and provide
plenty of detail and context.

## Development Guidelines

### Development Dependencies
- `black` (`pip3 install black`)
- `build` (`pip3 install build`)
- `make`
- `pip3`
- `podman`
- `pyenv`
- `pyright` (`pip3 install pyright`)
- `usort` (`pip3 install usort`)

#### Makefile
The [Makefile](./Makefile) has some useful targets for typical development
operations, like formatting, building, and locally installing the module.

To install the module in editable mode run `make develop`.
To run the server in development mode, run `make develop-server`.

See the content of the Makefile for other useful targets.

### Code Style

#### Automated Formatting
- Run `make format` to format to this codebase's standard.

#### Not Automated Styling
- The last sentence in a code comments, logs, or error messages should not end
in a period (`.`).
- Comments should be used generously.

### Testing
Automated tests are run with `make test`.

Automated tests should be developed for cases that clearly improve Boardwalk's
reliability, user and developer experience. Otherwise there is no specific
enforcement of test coverage.

### Versioning
The boardwalk pip module uses semantic versioning. Please make sure to update
the VERSION file along with any changes to the package.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.10 AS build
WORKDIR /build
COPY . .
RUN make build

FROM python:3.10-slim
COPY --from=build /build/dist ./dist
RUN python3 -m pip install ./dist/boardwalk-*.whl && mkdir /var/boardwalk && rm -rf ./dist
WORKDIR /var/boardwalk
ENTRYPOINT [ "python3", "-m"]
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include VERSION
76 changes: 76 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Builds module artifacts
.PHONY: build
build: dist

.PHONY: container
container:
podman build . --tag boardwalk:$(shell cat VERSION | tr -d '\n')

# Cleans up temporary data that might get created during normal devlopment
.PHONY: clean
clean:
rm -r \
build \
dist \
src/*.egg-info \
src/boardwalk/__pycache__ \
src/boardwalkd/__pycache__ \
.boardwalk \
.boardwalkd \
|| :
podman image rm localhost/boardwalk || :

# Installs modules in editable mode
.PHONY: develop
develop:
python3 -m pip install --editable .

.PHONY: develop-server
develop-server:
ifdef BOARDWALKD_SLACK_WEBHOOK_URL
boardwalkd serve \
--develop \
--host-header-pattern="(localhost|127\.0\.0\.1)" \
--port=8888 \
--slack-webhook-url="$(BOARDWALKD_SLACK_WEBHOOK_URL)" \
--url='http://localhost:8888'
else
boardwalkd serve \
--develop \
--host-header-pattern="(localhost|127\.0\.0\.1)" \
--port=8888 \
--url='http://localhost:8888'
endif

dist: clean
python3 -m pip install -U build pip
python3 -m build

# Applys project's required code style
.PHONY: format
format:
black .
usort format .


# Installs modules to the local system
.PHONY: install
install:
python3 -m pip install --upgrade .

# Runs all available tests
.PHONY: test
test: test-black test-pyright test-usort

# Test that code is formatted with black
.PHONY: test-black
test-black:
black . --check

.PHONY: test-pyright
test-pyright:
pyright

.PHONY: test-usort
test-usort:
usort check .
Loading

0 comments on commit 0d3d135

Please sign in to comment.