-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enter: docker * Remove unnecessary dockerfile dependency. Update README. * Kill Dockerfile in favor of CLI
- Loading branch information
Showing
2 changed files
with
67 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ROBOFLOW_API_KEY=your-roboflow-private-api-key | ||
PROJECT_NAME=your-project-name | ||
PROJECT_VERSION=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,41 +87,84 @@ Selecting the format you'd like your project to be exported as while choosing th | |
|
||
 | ||
|
||
## Deving locally | ||
1. clone repo | ||
2. create a virtual env: `virtualenv local_dev` | ||
3. activate virtual env: `source local_dev/bin/activate` | ||
4. install packages from repo: `pip3 install -e ".[dev]"` | ||
5. create script on top level of `ROBOFLOW-PYTHON` and reference local `roboflow` directory: `from roboflow import Roboflow` | ||
6. when done, uptick the pip package minor version number in `setup.py` | ||
7. manually add any new dependencies to the `requirements.txt` and list of dependencies in `setup.py` (careful not to overwrite any packages that might screw up backwards dependencies for object detection, etc.) | ||
## Developing locally | ||
|
||
### Code Quality | ||
### Using Docker | ||
|
||
We provide a `Makefile` to format and ensure code quality. **Be sure to run them before creating a PR**. | ||
To set the Docker container up for the first time: | ||
|
||
```bash | ||
# Clone this repo | ||
git clone [email protected]:roboflow-ai/roboflow-python.git && cd roboflow-python | ||
|
||
# Copy the environment variables template | ||
# Be sure to update the values with your account's information | ||
cp .env-example .env | ||
|
||
# Build and run a new docker container image | ||
docker run -it -v $(pwd):/roboflow --name roboflow python:3.8.14-slim /bin/bash | ||
|
||
# Install Dependencies | ||
cd roboflow/ && pip install -e ".[dev]" | ||
|
||
# Run tests | ||
python -m unittest | ||
``` | ||
# format your code with `black` and `isort` run | ||
make style | ||
# check code with flake8 | ||
make check_code_quality | ||
|
||
Running the Docker container after initial build: | ||
|
||
```bash | ||
docker start roboflow | ||
docker exec -it roboflow /bin/bash | ||
cd roboflow/ && python -m unittest | ||
``` | ||
|
||
**Note** This tests will be run automatically when you commit thanks to git hooks. | ||
### Using Virtualenv | ||
|
||
```bash | ||
# Clone this repo | ||
git clone [email protected]:roboflow-ai/roboflow-python.git && cd roboflow-python | ||
|
||
# create virtual env | ||
virtualenv local_dev | ||
|
||
### Tests | ||
# activate virtual env | ||
source local_dev/bin/activate | ||
|
||
You need to have the following `env` variables, | ||
# install dependencies | ||
pip3 install -e ".[dev]" | ||
``` | ||
|
||
### Testing | ||
|
||
You need to have the following `env` variables defined. If using docker along with the `.env` file, these will be automatically defined. | ||
|
||
``` | ||
ROBOFLOW_API_KEY="<YOUR_ROBOFLOW_API>" | ||
ROBOFLOW_API_KEY="<YOUR_ROBOFLOW_PRIVATE_API_KEY>" | ||
PROJECT_NAME="<YOUR_PROJECT_NAME>" | ||
PROJECT_VERSION="" # by default "1" | ||
PROJECT_VERSION="1" | ||
``` | ||
|
||
Then, assuming you have installed the `dev` packages (`pip install -e ".[dev]`), you can run the tests | ||
Run tests: | ||
|
||
```bash | ||
|
||
python -m unittest | ||
``` | ||
|
||
### Contributing | ||
|
||
1. Increment the pip package minor version number in `setup.py` | ||
1. Manually add any new dependencies to `requirements.txt` and list of dependencies in `setup.py` (Be careful not to overwrite any packages that might screw up backwards dependencies for object detection, etc.) | ||
|
||
### Code Quality | ||
|
||
We provide a `Makefile` to format and ensure code quality. **Be sure to run them before creating a PR**. | ||
|
||
``` | ||
# format your code with `black` and `isort` run | ||
make style | ||
# check code with flake8 | ||
make check_code_quality | ||
``` | ||
|
||
**Note** These tests will be run automatically when you commit thanks to git hooks. |