Skip to content

Commit

Permalink
Rename project from 'python-diff-annotator' to 'PatchScope'
Browse files Browse the repository at this point in the history
Also change the name of project from 'diffannotator' to 'patchscope'
in pyproject.toml.

Note that not every occurence of 'python-diff-annotator' was replaced,
and 'diffannotator' remains one of the packages in 'patchscope'.
  • Loading branch information
jnareb committed Nov 30, 2024
1 parent 0e52e95 commit 1f18696
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 18 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,32 @@
[![EditorConfig](https://img.shields.io/badge/Editor%20Config-E0EFEF?logo=editorconfig&logoColor=000)](https://editorconfig.org/)
[![Maturity badge - level 1](https://img.shields.io/badge/Maturity-Level%201%20--%20New%20Project-yellow.svg)](https://github.com/tophat/getting-started/blob/master/scorecard.md)

# Diff Annotator
# PatchScope

Annotates files and lines of diffs (patches) with their purpose and type,
and performs statistical analysis on the generated annotation data.

> _Note:_ this project was called 'python-diff-annotator' earlier in its history instead of 'PatchScope',
> and the python package was called 'diffannotator' instead of being called 'patchscope',
> so there are some references to that older name, for example in directory names
> in some Jupyter Notebooks.
## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install diffannotator.
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install patchscope.

To avoid dependency conflicts, it is strongly recommended to create
a [virtual environment][venv] first, activate it, and install diffannotator
a [virtual environment][venv] first, activate it, and install patchscope
into this environment. See also "_[Virtual environment](#virtual-environment)_"
subsection below.

To install the most recent version, use
```commandline
python -m pip install diffannotator@git+https://github.com/ncusi/python-diff-annotator#egg=main
python -m pip install patchscope@git+https://github.com/ncusi/PatchScope#egg=main
```
or (assuming that you can clone the repository with SSH)
```commandline
python -m pip install diffannotator@git+ssh://[email protected]/ncusi/python-diff-annotator.git#egg=main
python -m pip install patchscope@git+ssh://[email protected]/ncusi/PatchScope.git#egg=main
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion examples-init.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [ -z "$VIRTUAL_ENV" ]; then
fi

# virtualenv is initialized
echo "Installing 'diffannotator' (in editable mode), and its dependencies"
echo "Installing 'patchscope' (in editable mode), and its dependencies"
pip install -q --upgrade --editable .[examples]

# configuring DVC remote
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=62.6"]
build-backend = "setuptools.build_meta"

[project]
name = "diffannotator"
name = "patchscope"
# 'version' is now defined dynamically
description = "Annotate files and lines of diffs (patches) with their purpose and type"
readme = "README.md"
Expand Down Expand Up @@ -40,8 +40,8 @@ diff-annotate = "diffannotator.annotate:app"
diff-gather-stats = "diffannotator.gather_data:app"

[project.urls]
bugs = "https://github.com/ncusi/python-diff-annotator/issues"
homepage = "https://github.com/ncusi/python-diff-annotator"
bugs = "https://github.com/ncusi/PatchScope/issues"
homepage = "https://github.com/ncusi/PatchScope"

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
Expand Down
5 changes: 3 additions & 2 deletions src/diffannotator/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
create annotation data for commits from local Git repository
(with `REVISION_RANGE...` passed as arguments to the `git log` command);
Example (after installing the 'diffannotator' package):
Example (after installing the 'patchscope' package):
diff-annotate --help
diff-annotate --use-pylinguist patch \
Expand Down Expand Up @@ -2171,7 +2171,8 @@ def common(
Use either
python -m pip install --editable .[pylinguist]
python -m pip install diffannotator[pylinguist]
or
python -m pip install patchscope[pylinguist]
or
python -m pip install git+https://github.com/retanoj/linguist@master
Expand Down
2 changes: 1 addition & 1 deletion src/diffannotator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Optional


__version__: str = "0.2.0"
__version__: str = "0.3.0"

# configure logging
logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion src/diffannotator/gather_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- `diff-gather-stats timeline [OPTIONS] OUTPUT_FILE DATASETS...`:
calculate timeline of bugs with per-bug count of different types of lines.
Example (after installing the 'diffannotator' package):
Example (after installing the 'patchscope' package):
diff-gather-stats --help
diff-gather-stats --annotations-dir='' purpose-counter \
Expand Down
6 changes: 3 additions & 3 deletions src/diffannotator/generate_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
the `annotate.py` script, and then further for gathering statistics with
the `gather_data.py` script.
Example (after installing the 'diffannotator' package):
diff-generate python-diff-annotator \
--output-dataset=diffannotator/user-jnareb --author=jnareb
Example (after installing the 'patchscope' package):
diff-generate PatchScope \
--output-dataset=patchscope/user-jnareb --author=jnareb
"""
import logging
import os
Expand Down
2 changes: 1 addition & 1 deletion src/diffinsights_web/apps/contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

# Create the dashboard layout
template = pn.template.MaterialTemplate(
site="diffannotator",
site="PatchScope",
title="Contributors Graph", # TODO: make title dynamic
favicon="favicon.svg",
sidebar=[
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging

# noinspection PyPackageRequirements
import pytest # included in diffannotator[dev], which is defined in pypackage.toml
import pytest # included in .[dev] / patchscope[dev], which is defined in pypackage.toml
from pathlib import Path

from diffannotator.config import guess_format_version, JSONFormat
Expand Down

0 comments on commit 1f18696

Please sign in to comment.