py-concodese


Namepy-concodese JSON
Version 1.1.2 PyPI version JSON
download
home_page
SummaryGiven a bug report, suggests code files that may need to be fixed
upload_time2023-06-29 13:46:16
maintainer
docs_urlNone
author
requires_python>=3.8
licenseBSD 3-Clause License Copyright (c) 2021, The Open University, UK Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords bug localisation recommender system
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # README

PyConCodeSe is a bug localisation tool: 
given a bug report it suggests 10 code files that may contain the bug. 

For PyConCodeSe to work it needs a [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar 
to parse your code (we currently support Java, C#, PHP and Rust) and 
the [spaCy](http://spacy.io) library to parse the bug report and any natural language text in the code.

After installing the software as per the following instructions,
you will need to edit a configuration file for each code repo.
The configuration tells PyConCodeSe where your code and your bug reports are.

## Installation

You need at least Python 3.8 to run PyConCodeSe and we strongly recommend you install it in a 
[virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments).
On Unix (incl. macOS) you would type in a terminal something like:
```bash
python3.11 -m venv venv
source venv/bin/activate
```
to create and activate a virtual environment in subfolder `venv` of your current folder.
Next, type
```bash
pip install -i py-concodese
```
to install everything in the current environment and create the main executable script `pyconcodese`.
Finally, set up spaCy with
```bash
python -m spacy download en_core_web_sm
```
Now you can run `pyconcodese` from any folder, as long as you have the virtual environment activated.

## Configuration

When running PyConCodeSe, if there's no file `config.toml` in the current folder, 
you're prompted to create one with example values.
```bash
pyconcodese 

The PyConcodese config file 'config.toml' was not found in this path. 
 Do you want to copy an example file here? [y/N]y
Example config.toml file copied in the current directory.  
 Please make sure you change the fields accordingly
```
Open the configuration file and edit the paths of the various folders:
```toml
[py-concodese]
# the path that contains grammars (e.g. the folder that contains "tree-sitter-c-master")
# If you don't have a grammar fplder, Set up an empty folder here and Pyconcodese will download the grammars from Github
grammar_path = "/tmp/Pyconcodese/Grammars"

# the next 3 can be the root directory of the application if you wish (e.g.)
# the directory that you would like to store the sqlite database(s) in
sqlite_path = "/tmp/Pyconcodese"
# the directory that you would like to store the vsm data folders in
vsm_path = "/tmp/Pyconcodese"
# where to store output files generated by the application
output_path = "/tmp/Pyconcodese"

derby_path = "/tmp/Pyconcodese/derby"
```
The `grammar_path` is the folder where the Tree-sitter grammar files will be put.
When running `pyconcodese`, you will be asked if you want to update the grammars:
this will automatically download the latest version from GitHub to the `grammar_path` folder.
You can share the grammar folder between projects, but make sure the `grammar_path` you select 
is an empty folder when running PyConCodeSe for the first time.
The grammar update will fail if the folder already contains files that are not git-versioned
but have the same name as the ones on GitHub. 


```toml
[dataset]
bug_repository_file = "/tmp/Pyconcodese/bug_repository_file.xml"
src_path = "/tmp/Pyconcodese"
```

The config.toml file will be created with the current path prefilled as a starting point for all these values.


## Dataset format
The dataset (bug reports) that you want to use should be in a particular format. Necessary fields that should be present in the dataset are: **issue_id**, **issue_summary**, **issue_description**, **issue_status** and **files_changed**. 

The following examples show the correct format in which the dataset should be aligned: 

### Json version
```json
{
    "closed_issues": {
        "1": {
            "issue_id": "#3085",
            "issue_summary": "Missing PR_SET_PTRACER_ANY",
            "issue_description": "JonathanWoollett-Light…..search=PR_SET_PTRACER_ANY).",
            "issue_status": "Closed",
            "files_changed": [
                [
                    "1",
                    "libc-test/semver/fuchsia.txt"
                ],
                [
                    "1",
                    "libc-test/semver/linux.txt"
                ],
                [ 
                    "1", 
                    "src/fuchsia/mod.rs" 
                ], 
                [ 
                    "1", 
                    "src/unix/linux_like/emscripten/mod.rs" 
                ], 
                [ 
                    "1", 
                    "src/unix/linux_like/linux/mod.rs" 
                ] 
            ] 
        }, 
        "437": { 
            "issue_id": "#100", 
            "issue_summary": "Outdated MIPS toolchain", 
            "issue_description": "Contributor…..further.", 
            "issue_status": "Closed", 
            "issue_reporting_time": "", 
            "fixed_by": "#114", 
            "files_changed": [ 
                [ 
                    "1", 
                    "src/unix/notbsd/linux/mips.rs" 
                ], 
                [ 
                    "1", 
                    "src/unix/notbsd/linux/mod.rs" 
                ], 
                [ 
                    "1", 
                    "src/unix/notbsd/linux/musl.rs" 
                ], 
                [ 
                    "1", 
                    "src/unix/notbsd/linux/other/mod.rs" 
                ] 
            ] 
        } 
    } 
} 
```

### XML version
```xml
<?xml version="1.0" encoding="ISO-8859-1"?>

<bugrepository name="SWT">
  <bug id="88829" opendate="2005-03-22 20:41:00" fixdate="2005-04-06 17:05:00">
    <buginformation>
      <summary>Table.setColumnOrder() may not fire enough Move events</summary>
      <description>- start with five columns, all different widths - do Table.setColumnOrder(new int[] {4,1,2,3,0}); - SWT.Move events are fired for columns 0 and 4 because they swapped positions -&amp;gt; but Move should have been fired for all of the columns since the width of the first displayed column changed, and therefore all of the other columns are auto-shifted accordingly</description>
    </buginformation>
    <fixedFiles>
      <file>org.eclipse.swt.widgets.Table.java</file>
    </fixedFiles>
  </bug>
  <bug id="90018" opendate="2005-04-01 14:40:00" fixdate="2005-04-05 08:14:00">
    <buginformation>
      <summary>Native tooltips left around on CTabFolder</summary>
      <description>Hover over the PartStack CTabFolder inside eclipse until some native tooltip is displayed. For example, the maximize button. When the tooltip appears, change perspectives using the keybinding. the CTabFolder gets hidden, but its tooltip is permanently displayed and never goes away. Even if that CTabFolder is disposed (I'm assuming) when the perspective is closed.</description>
    </buginformation>
    <fixedFiles>
      <file>org.eclipse.swt.custom.CTabFolder.java</file>
    </fixedFiles>
  </bug>
</bugrepository>
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "py-concodese",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "bug localisation,recommender system",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/e7/c2/2f346b2904d00e338d82a87bb6e1f2ee333d850124c3bd6ac9a61c259297/py_concodese-1.1.2.tar.gz",
    "platform": null,
    "description": "# README\n\nPyConCodeSe is a bug localisation tool: \ngiven a bug report it suggests 10 code files that may contain the bug. \n\nFor PyConCodeSe to work it needs a [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammar \nto parse your code (we currently support Java, C#, PHP and Rust) and \nthe [spaCy](http://spacy.io) library to parse the bug report and any natural language text in the code.\n\nAfter installing the software as per the following instructions,\nyou will need to edit a configuration file for each code repo.\nThe configuration tells PyConCodeSe where your code and your bug reports are.\n\n## Installation\n\nYou need at least Python 3.8 to run PyConCodeSe and we strongly recommend you install it in a \n[virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments).\nOn Unix (incl. macOS) you would type in a terminal something like:\n```bash\npython3.11 -m venv venv\nsource venv/bin/activate\n```\nto create and activate a virtual environment in subfolder `venv` of your current folder.\nNext, type\n```bash\npip install -i py-concodese\n```\nto install everything in the current environment and create the main executable script `pyconcodese`.\nFinally, set up spaCy with\n```bash\npython -m spacy download en_core_web_sm\n```\nNow you can run `pyconcodese` from any folder, as long as you have the virtual environment activated.\n\n## Configuration\n\nWhen running PyConCodeSe, if there's no file `config.toml` in the current folder, \nyou're prompted to create one with example values.\n```bash\npyconcodese \n\nThe PyConcodese config file 'config.toml' was not found in this path. \n Do you want to copy an example file here? [y/N]y\nExample config.toml file copied in the current directory.  \n Please make sure you change the fields accordingly\n```\nOpen the configuration file and edit the paths of the various folders:\n```toml\n[py-concodese]\n# the path that contains grammars (e.g. the folder that contains \"tree-sitter-c-master\")\n# If you don't have a grammar fplder, Set up an empty folder here and Pyconcodese will download the grammars from Github\ngrammar_path = \"/tmp/Pyconcodese/Grammars\"\n\n# the next 3 can be the root directory of the application if you wish (e.g.)\n# the directory that you would like to store the sqlite database(s) in\nsqlite_path = \"/tmp/Pyconcodese\"\n# the directory that you would like to store the vsm data folders in\nvsm_path = \"/tmp/Pyconcodese\"\n# where to store output files generated by the application\noutput_path = \"/tmp/Pyconcodese\"\n\nderby_path = \"/tmp/Pyconcodese/derby\"\n```\nThe `grammar_path` is the folder where the Tree-sitter grammar files will be put.\nWhen running `pyconcodese`, you will be asked if you want to update the grammars:\nthis will automatically download the latest version from GitHub to the `grammar_path` folder.\nYou can share the grammar folder between projects, but make sure the `grammar_path` you select \nis an empty folder when running PyConCodeSe for the first time.\nThe grammar update will fail if the folder already contains files that are not git-versioned\nbut have the same name as the ones on GitHub. \n\n\n```toml\n[dataset]\nbug_repository_file = \"/tmp/Pyconcodese/bug_repository_file.xml\"\nsrc_path = \"/tmp/Pyconcodese\"\n```\n\nThe config.toml file will be created with the current path prefilled as a starting point for all these values.\n\n\n## Dataset format\nThe dataset (bug reports) that you want to use should be in a particular format. Necessary fields that should be present in the dataset are: **issue_id**, **issue_summary**, **issue_description**, **issue_status** and **files_changed**. \n\nThe following examples show the correct format in which the dataset should be aligned: \n\n### Json version\n```json\n{\n    \"closed_issues\": {\n        \"1\": {\n            \"issue_id\": \"#3085\",\n            \"issue_summary\": \"Missing PR_SET_PTRACER_ANY\",\n            \"issue_description\": \"JonathanWoollett-Light\u2026..search=PR_SET_PTRACER_ANY).\",\n            \"issue_status\": \"Closed\",\n            \"files_changed\": [\n                [\n                    \"1\",\n                    \"libc-test/semver/fuchsia.txt\"\n                ],\n                [\n                    \"1\",\n                    \"libc-test/semver/linux.txt\"\n                ],\n                [ \n                    \"1\", \n                    \"src/fuchsia/mod.rs\" \n                ], \n                [ \n                    \"1\", \n                    \"src/unix/linux_like/emscripten/mod.rs\" \n                ], \n                [ \n                    \"1\", \n                    \"src/unix/linux_like/linux/mod.rs\" \n                ] \n            ] \n        }, \n        \"437\": { \n            \"issue_id\": \"#100\", \n            \"issue_summary\": \"Outdated MIPS toolchain\", \n            \"issue_description\": \"Contributor\u2026..further.\", \n            \"issue_status\": \"Closed\", \n            \"issue_reporting_time\": \"\", \n            \"fixed_by\": \"#114\", \n            \"files_changed\": [ \n                [ \n                    \"1\", \n                    \"src/unix/notbsd/linux/mips.rs\" \n                ], \n                [ \n                    \"1\", \n                    \"src/unix/notbsd/linux/mod.rs\" \n                ], \n                [ \n                    \"1\", \n                    \"src/unix/notbsd/linux/musl.rs\" \n                ], \n                [ \n                    \"1\", \n                    \"src/unix/notbsd/linux/other/mod.rs\" \n                ] \n            ] \n        } \n    } \n} \n```\n\n### XML version\n```xml\n<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n<bugrepository name=\"SWT\">\n  <bug id=\"88829\" opendate=\"2005-03-22 20:41:00\" fixdate=\"2005-04-06 17:05:00\">\n    <buginformation>\n      <summary>Table.setColumnOrder() may not fire enough Move events</summary>\n      <description>- start with five columns, all different widths - do Table.setColumnOrder(new int[] {4,1,2,3,0}); - SWT.Move events are fired for columns 0 and 4 because they swapped positions -&amp;gt; but Move should have been fired for all of the columns since the width of the first displayed column changed, and therefore all of the other columns are auto-shifted accordingly</description>\n    </buginformation>\n    <fixedFiles>\n      <file>org.eclipse.swt.widgets.Table.java</file>\n    </fixedFiles>\n  </bug>\n  <bug id=\"90018\" opendate=\"2005-04-01 14:40:00\" fixdate=\"2005-04-05 08:14:00\">\n    <buginformation>\n      <summary>Native tooltips left around on CTabFolder</summary>\n      <description>Hover over the PartStack CTabFolder inside eclipse until some native tooltip is displayed. For example, the maximize button. When the tooltip appears, change perspectives using the keybinding. the CTabFolder gets hidden, but its tooltip is permanently displayed and never goes away. Even if that CTabFolder is disposed (I'm assuming) when the perspective is closed.</description>\n    </buginformation>\n    <fixedFiles>\n      <file>org.eclipse.swt.custom.CTabFolder.java</file>\n    </fixedFiles>\n  </bug>\n</bugrepository>\n```\n\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2021, The Open University, UK  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
    "summary": "Given a bug report, suggests code files that may need to be fixed",
    "version": "1.1.2",
    "project_urls": null,
    "split_keywords": [
        "bug localisation",
        "recommender system"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bae10408c8517faef8fc520021fbdd2e7da8762196db9cd17da62b4a72dc6424",
                "md5": "9015e95fd8c2617ce7388c123359896e",
                "sha256": "96e7890695ad58f171818fc9e8bfbc473a7ad0458ee67f9263c369fca5ea664f"
            },
            "downloads": -1,
            "filename": "py_concodese-1.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9015e95fd8c2617ce7388c123359896e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 14814612,
            "upload_time": "2023-06-29T13:46:10",
            "upload_time_iso_8601": "2023-06-29T13:46:10.739838Z",
            "url": "https://files.pythonhosted.org/packages/ba/e1/0408c8517faef8fc520021fbdd2e7da8762196db9cd17da62b4a72dc6424/py_concodese-1.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e7c22f346b2904d00e338d82a87bb6e1f2ee333d850124c3bd6ac9a61c259297",
                "md5": "1a15bb7bbb814a8ca8ba87ba8aa8a054",
                "sha256": "184d5319a01086b191ae33280a5a94f635872b828ea0f783289cd253562cb161"
            },
            "downloads": -1,
            "filename": "py_concodese-1.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "1a15bb7bbb814a8ca8ba87ba8aa8a054",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14818157,
            "upload_time": "2023-06-29T13:46:16",
            "upload_time_iso_8601": "2023-06-29T13:46:16.916645Z",
            "url": "https://files.pythonhosted.org/packages/e7/c2/2f346b2904d00e338d82a87bb6e1f2ee333d850124c3bd6ac9a61c259297/py_concodese-1.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-29 13:46:16",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "py-concodese"
}
        
Elapsed time: 0.10080s