Skip to content

Commit

Permalink
Feature/coverage (#8)
Browse files Browse the repository at this point in the history
* Added coverage package

* Added Makefile

Added sonarcloud configuration file
Added sonarcloud action and make actions

* Migrate from setup.py to setuptools/build

* Added sonar.sources

* Added sonar.sources

* Fix target name

* Fix target name

* Fix filename

* Remove sonar and upload coverage results

* fix codacy

* fix codacy
  • Loading branch information
mivek authored Mar 20, 2021
1 parent 8b09347 commit b9a1625
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 33 deletions.
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[run]
branch = True
source = metar_taf_parser
command_line = -m unittest
16 changes: 12 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand All @@ -25,13 +27,19 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pipenv
python -m pipenv install -d
make install
- name: Lint with flake8
run: |
flake8 .
- name: Test with unittest
- name: Test with unittest and generates reports
run: |
python -m pipenv run python -m unittest
make report
- name: Upload coverage results
uses: actions/upload-artifact@v2
with:
name: coverage.xml
path: ./coverage.xml
if: ${{ always() }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade build setuptools wheel twine
make install_deploy
- name: Build the archives
run: |
python setup.py bdist_wheel
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# Change Log

## [TBD] - TBD
## [1.1.0] - 2021-03-XX

### Added

- i18n module to support English, French, German and Polish locales.
- Remarks are now parsed and converted in readable sentence.
- Remarks are now parsed and converted in a readable sentence.
The value is stored in properties `remark` and `remarks`. The `remarks` property contains an element for each remark or
token. The `remark` property contains the whole decoded remarks in a sentence.

- Makefile and `pyproject.toml`.

- Coverage measurement.

### Changed

- The packaging now uses setuptools and build modules instead of `setup.py`.


## [1.0.1] - 2021-02-28

### Changed
Expand Down
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
PYTHON = python


clean:
@echo "Cleaning up..."
rm -rf ./metar_taf_parser_mivek.egg-info/
rm -rf ./build/
rm -rf ./dist/
rm -rf ./htmlcov/
rm -rf ./.coverage
rm -rf ./coverage.json
rm -rf ./coverage.xml

test:
@echo "Launching test"
${PYTHON} -m pipenv run coverage run -m unittest

report: test
${PYTHON} -m pipenv run coverage html
${PYTHON} -m pipenv run coverage xml
${PYTHON} -m pipenv run coverage json

lock:
${PYTHON} -m pipenv lock

install:
@echo "Install dependencies"
${PYTHON} -m pip install flake8 pipenv
${PYTHON} -m pipenv install -d

install_deploy:
@echo "Install build/deployment dependencies"
${PYTHON} -m pip install --upgrade build twine
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ verify_ssl = true

[dev-packages]
parameterized = "*"
coverage = "*"

[packages]

Expand Down
60 changes: 59 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
build-backend = "setuptools.build_meta"
32 changes: 32 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[metadata]
name = metar-taf-parser-mivek
version = 1.1.0
author = Jean-Kevin KPADEY
author_email = [email protected]
description = Python project parsing metar and taf message
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/mivek/python-metar-taf-parser
project_urls =
Bug Tracker = https://github.com/mivek/python-metar-taf-parser/issues
classifiers =
Programming Language :: Python :: 3
License :: OSI Approved :: MIT License
Operating System :: OS Independent
license_file = LICENSE
keywords =
metar
taf
parser
icao
airport

[options]
packages = find:
python_requires = >=3.6
tests_require =
parameterized
coverage

[options.packages.find]
where = src
24 changes: 0 additions & 24 deletions setup.py

This file was deleted.

0 comments on commit b9a1625

Please sign in to comment.