Skip to content

Commit a2ba4c7

Browse files
committed
Modernize build process
1 parent df2c8d1 commit a2ba4c7

21 files changed

+230
-165
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ If applicable, add screenshots to help explain your problem.
2121

2222
**Desktop (please complete the following information):**
2323
- OS: [e.g. Ubuntu]
24-
- Version [e.g. 0.1.0]
24+
- Version [e.g. 0.2.0]
2525

2626

2727
**Additional context**

AUTHORS.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 43 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ You can contribute in many ways:
77

88
## Types of Contributions
99

10-
1110
### Report Bugs
1211

1312
Report bugs at https://github.com/shoumikchow/bbox-visualizer/issues.
@@ -20,7 +19,6 @@ If you are reporting a bug, please include:
2019

2120
### Fix Bugs
2221

23-
2422
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
2523
wanted" is open to whoever wants to implement it.
2624

@@ -31,14 +29,12 @@ and "help wanted" is open to whoever wants to implement it.
3129

3230
### Write Documentation
3331

34-
3532
bbox-visualizer could always use more documentation, whether as part of the
3633
official bbox_visualizer docs, in docstrings, or even on the web in blog posts,
3734
articles, and such.
3835

3936
### Submit Feedback
4037

41-
4238
The best way to send feedback is to file an issue at https://github.com/shoumikchow/bbox-visualizer/issues.
4339

4440
If you are proposing a feature:
@@ -50,56 +46,76 @@ If you are proposing a feature:
5046

5147
## Get Started!
5248

53-
5449
Ready to contribute? Here's how to set up `bbox_visualizer` for local development.
5550

5651
1. Fork the `bbox_visualizer` repo on GitHub.
57-
2. Clone your fork locally::
5852

53+
2. Clone your fork locally:
5954
```bash
6055
git clone git@github.com:your_name_here/bbox_visualizer.git
6156
```
6257

63-
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
64-
58+
3. Install uv if you haven't already:
6559
```bash
66-
mkvirtualenv bbox_visualizer
67-
cd bbox_visualizer/
68-
python setup.py develop
60+
pip install uv
6961
```
7062
71-
4. Create a branch for local development::
63+
4. Set up your development environment:
64+
```bash
65+
cd bbox_visualizer
66+
uv venv
67+
uv pip install -e ".[dev]"
68+
```
7269
70+
5. Create a branch for local development:
7371
```bash
7472
git checkout -b name-of-your-bugfix-or-feature
7573
```
7674
77-
Now you can make your changes locally.
78-
79-
5. When you're done making changes, check that your changes pass flake8::
75+
6. Make your changes. Don't forget to add tests!
8076

77+
7. Format and lint your code:
8178
```bash
82-
flake8 bbox_visualizer demo
79+
# Format with black
80+
uv pip run black .
81+
82+
# Run linting checks with ruff
83+
uv pip run ruff check .
84+
85+
# Auto-fix ruff issues where possible
86+
uv pip run ruff check --fix .
87+
88+
# Run tests
89+
uv pip run pytest
8390
```
8491

85-
To get flake8, just pip install it into your virtualenv.
86-
87-
6. Commit your changes and push your branch to GitHub::
88-
92+
8. Commit your changes and push your branch to GitHub:
8993
```bash
9094
git add .
9195
git commit -m "Your detailed description of your changes."
9296
git push origin name-of-your-bugfix-or-feature
9397
```
9498

95-
7. Submit a pull request through the GitHub website.
96-
97-
### Pull Request Guidelines
99+
9. Submit a pull request through the GitHub website.
98100

101+
## Pull Request Guidelines
99102

100103
Before you submit a pull request, check that it meets these guidelines:
101104

102-
1. If the pull request adds functionality, the docs should be updated. Put
103-
your new functionality into a function with a docstring, and add the
104-
feature to the list in README.rst.
105-
2. The pull request should work for Python 3.5, 3.6, 3.7 and 3.8, and for PyPy.
105+
1. The pull request should include tests.
106+
2. If the pull request adds functionality, the docs should be updated:
107+
* Add your new functionality into a function with a docstring
108+
* Update the README.md with any new usage instructions
109+
3. The pull request should work for Python 3.8 and above.
110+
4. Make sure all tests pass and the code is formatted with black and passes ruff checks.
111+
112+
## Development Tools
113+
114+
This project uses modern Python development tools:
115+
116+
* **uv**: Fast Python package installer and resolver
117+
* **black**: Code formatter
118+
* **ruff**: Fast Python linter
119+
* **pytest**: Testing framework
120+
121+
All development dependencies are specified in the `pyproject.toml` file and will be installed when you install the package with the `[dev]` extra.

HISTORY.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 10 deletions
This file was deleted.

Makefile

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,14 @@ clean-test: ## remove test and coverage artifacts
4747
rm -fr htmlcov/
4848
rm -fr .pytest_cache
4949

50-
lint: ## check style with flake8
51-
flake8 bbox_visualizer demo
50+
lint: ## check style with ruff
51+
uv pip run ruff check bbox_visualizer demo tests examples
52+
53+
format: ## format code with black
54+
uv pip run black bbox_visualizer demo tests examples
55+
56+
test: ## run tests with pytest
57+
uv pip run pytest
5258

5359
docs: ## generate Sphinx HTML documentation, including API docs
5460
rm -f docs/bbox_visualizer.rst
@@ -63,13 +69,15 @@ docs: ## generate Sphinx HTML documentation, including API docs
6369
servedocs: docs ## compile the docs watching for changes
6470
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
6571

66-
release: dist ## package and upload a release
67-
twine upload dist/*
72+
build: clean ## builds source and wheel package
73+
uv pip run python -m build
6874

69-
dist: clean ## builds source and wheel package
70-
python setup.py sdist
71-
python setup.py bdist_wheel
72-
ls -l dist
75+
release: build ## package and upload a release
76+
uv pip run python -m twine check dist/*
77+
uv pip run python -m twine upload dist/*
7378

7479
install: clean ## install the package to the active Python's site-packages
75-
python setup.py install
80+
uv pip install .
81+
82+
dev-install: clean ## install the package in development mode with all extras
83+
uv pip install -e ".[dev]"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Documentation Status](https://readthedocs.org/projects/bbox-visualizer/badge/?version=latest)](https://bbox-visualizer.readthedocs.io/en/latest/?badge=latest)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5-
[![PyPI version](https://badge.fury.io/py/bbox-visualizer.svg)](https://pypi.org/project/bbox-visualizer/0.1.0/)
5+
[![PyPI version](https://badge.fury.io/py/bbox-visualizer.svg)](https://pypi.org/project/bbox-visualizer/0.2.0/)
66
[![Downloads](https://pepy.tech/badge/bbox-visualizer)](https://pepy.tech/project/bbox-visualizer)
77

88
This package helps users draw bounding boxes around objects, without doing the clumsy math that you'd need to do for positioning the labels. It also has a few different types of visualizations you can use for labeling objects after identifying them.

bbox_visualizer/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""Top-level package for bbox-visualizer."""
22

3+
from ._version import __version__
4+
35
__author__ = """Shoumik Sharar Chowdhury"""
46
__email__ = 'shoumikchow@gmail.com'
5-
__version__ = '0.1.0'
67

78
from .bbox_visualizer import (
89
draw_rectangle,

bbox_visualizer/_version.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Version information."""
2+
3+
__version__ = "0.2.0"

docs/AUTHORS.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)