Skip to content

Commit a6bfa93

Browse files
authored
PYSCAN-69 Rename scanner to pysonar-scanner (#69)
1 parent 64e2b41 commit a6bfa93

19 files changed

+68
-68
lines changed

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,6 @@ promote_task:
158158
BURGR_URL: VAULT[development/kv/data/burgr data.url]
159159
BURGR_USERNAME: VAULT[development/kv/data/burgr data.cirrus_username]
160160
BURGR_PASSWORD: VAULT[development/kv/data/burgr data.cirrus_password]
161-
ARTIFACTS: :pysonar:tar.gz,:pysonar:whl:py3-none-any
161+
ARTIFACTS: :pysonar_scanner:tar.gz,:pysonar_scanner:whl:py3-none-any
162162
<<: *POETRY_TEMPLATE
163163
promote_script: cirrus_promote

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Install poetry with `pipx install poetry`
1111

1212
# Run the main script
1313

14-
Run `python src/pysonar`
14+
Run `python src/pysonar_scanner`
1515

1616
# Run the tests
1717

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# pysonar
1+
# pysonar-scanner
22
A wrapper around SonarScanner CLI, available on PyPI.
33

44
# Disclaimer
@@ -15,34 +15,34 @@ These changes include configuration parameter names.
1515

1616
Install with pip:
1717
```
18-
pip install pysonar
18+
pip install pysonar-scanner
1919
```
2020

2121
# Usage
2222

23-
Once installed, the `pysonar` can be run from the command line to perform an analysis.
23+
Once installed, the `pysonar-scanner` can be run from the command line to perform an analysis.
2424
It assumes a running SonarQube server or a project configured on SonarCloud.
2525

2626
## Setting up analysis properties
2727

2828
In order for the analysis to run, analysis properties need to be defined.
2929
There are multiple ways of providing these properties, described below in descending order of priority:
3030

31-
* Through CLI arguments to the `pysonar` command
31+
* Through CLI arguments to the `pysonar-scanner` command
3232
* Under the `[tool.sonar]` key of the `pyproject.toml` file
3333
* Through common properties extracted from the `pyproject.toml`
3434
* In a dedicated `sonar-project.properties` file
3535
* Through environment variables
3636

3737
### Through CLI arguments
3838

39-
Analysis properties can be provided as CLI arguments to the `pysonar` command.
39+
Analysis properties can be provided as CLI arguments to the `pysonar-scanner` command.
4040
They follow the same convention as when running the SonarScanner CLI directly
4141
(see [documentation](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/#running-from-zip-file)).
4242
This means that analysis properties provided that way should be prepended with `-D`, for instance:
4343

4444
```
45-
$ pysonar -Dsonar.login=myAuthenticationToken
45+
$ pysonar-scanner -Dsonar.login=myAuthenticationToken
4646
```
4747

4848
You can use all the argument allowed by __SonarScanner__.
@@ -79,13 +79,13 @@ By default, the scanner will expect the `pyproject.toml` file to be present in t
7979
However, its path can be provided manually through the `toml.path` ([PYSCAN-40](https://sonarsource.atlassian.net/jira/software/c/projects/PYSCAN/issues/PYSCAN-40)) CLI argument as well as through the `sonar.projectHome` argument. For instance:
8080

8181
```
82-
pysonar -Dtoml.path="path/to/pyproject.toml"
82+
pysonar-scanner -Dtoml.path="path/to/pyproject.toml"
8383
```
8484

8585
Or:
8686

8787
```
88-
pysonar -Dsonar.projectHome="path/to/projectHome"
88+
pysonar-scanner -Dsonar.projectHome="path/to/projectHome"
8989
```
9090

9191

@@ -127,7 +127,7 @@ It is also possible to define configure the scanner through environment variable
127127

128128
```
129129
$ export SONAR_HOST_URL="http://localhost:9000"
130-
$ pysonar
130+
$ pysonar-scanner
131131
```
132132

133133
See the __SonarScanner__ [documentation](https://docs.sonarsource.com/sonarqube/9.9/analyzing-source-code/scanners/sonarscanner/) for more information.
@@ -137,7 +137,7 @@ See the __SonarScanner__ [documentation](https://docs.sonarsource.com/sonarqube/
137137
To install the latest pre-released version of Sonar Scanner Python. Execute the following command:
138138

139139
```shell
140-
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pysonar
140+
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pysonar-scanner
141141
```
142142

143143
# License

its/poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

its/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
44

55
[tool.poetry]
66
# PYSCAN-35: Decide on definitive package name
7-
name = "pysonar-its"
7+
name = "pysonar-scanner-its"
88
version = "0.0.1"
99
authors = ['Python Squad <[email protected]>']
1010
description = "Integration tests for Sonar Scanner for the Python Ecosystem"
@@ -40,7 +40,7 @@ black = ">=23.12.0"
4040
pytest = ">=7.4.3"
4141
pytest-docker = ">=2.0.1"
4242
requests = "2.31.0"
43-
pysonar = { "path" = "../" }
43+
pysonar-scanner = { "path" = "../" }
4444

4545
[[tool.poetry.source]]
4646
name = 'jfrog-server'

its/utils/cli_client.py

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

2626
class CliClient():
2727

28-
SCANNER_CMD: str = "pysonar"
28+
SCANNER_CMD: str = "pysonar-scanner"
2929
SOURCES_FOLDER_PATH: str = os.path.join(
3030
os.path.dirname(__file__), "../sources")
3131

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers = ['Environment :: Console', 'Intended Audience :: Developers', 'Ope
2323
description = 'Sonar Scanner for the Python Ecosystem'
2424
keywords = ['sonar', 'sonarqube', 'sonarcloud', 'cleancode']
2525
license = 'LGPL-3.0-only'
26-
name = 'pysonar'
26+
name = 'pysonar-scanner'
2727
readme = 'README.md'
2828
version = '0.1.0'
2929

@@ -45,10 +45,10 @@ pytest-cov = '>=4.1.0'
4545

4646
[[tool.poetry.packages]]
4747
from = 'src'
48-
include = 'pysonar'
48+
include = 'pysonar_scanner'
4949

5050
[tool.poetry.scripts]
51-
pysonar = 'pysonar.__main__:scan'
51+
pysonar-scanner = 'pysonar_scanner.__main__:scan'
5252

5353
[[tool.poetry.source]]
5454
name = 'jfrog-server'
File renamed without changes.

src/pysonar/__main__.py renamed to src/pysonar_scanner/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
# along with this program; if not, write to the Free Software Foundation,
1818
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1919
#
20-
from pysonar.configuration import Configuration
21-
from pysonar.environment import Environment
22-
from pysonar.logger import ApplicationLogger
20+
from pysonar_scanner.configuration import Configuration
21+
from pysonar_scanner.environment import Environment
22+
from pysonar_scanner.logger import ApplicationLogger
2323

2424

2525
def scan():

src/pysonar/configuration.py renamed to src/pysonar_scanner/configuration.py

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

2828
import toml
2929

30-
from pysonar.logger import ApplicationLogger
30+
from pysonar_scanner.logger import ApplicationLogger
3131

3232

3333
class Configuration:

0 commit comments

Comments
 (0)