Skip to content

Commit

Permalink
Merge branch 'PYPI' into 'master'
Browse files Browse the repository at this point in the history
Pypi

### What does this MR do?

- Renames PyStalk to MetaStalk
- Creates PyPi Package for MetaStalk

### Related issues

See merge request Cyb3r-Jak3/metastalk!13
  • Loading branch information
Cyb3r-Jak3 committed May 3, 2020
2 parents cb86614 + 6aa099d commit b33fcc7
Show file tree
Hide file tree
Showing 47 changed files with 555 additions and 302 deletions.
9 changes: 0 additions & 9 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ plugins:
enabled: false
python:S3776:
enabled: false
markdownlint:
enabled: true
checks:
MD024:
enabled: false
MD009:
enabled: false
MD013:
enabled: false
pep8:
enabled: true
bandit:
Expand Down
5 changes: 2 additions & 3 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
version = 1

test_patterns = [
"Pystalk.py",
"modules/**",
"utils/**"
"MetaStalk/**",
]
exclude_patterns = ["MetaStalk/tests/*"]

[[analyzers]]
name = "python"
Expand Down
141 changes: 107 additions & 34 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,141 @@
stages:
- Code_Checking
- lint
- test
- Test_Build
- Deploy_to_PyPi

include:
- template: SAST.gitlab-ci.yml
- template: Dependency-Scanning.gitlab-ci.yml
- template: License-Scanning.gitlab-ci.yml

dependency_scanning:
only:
refs:
- tags
- master

license_scanning:
only:
refs:
- tags
- master

# This job will fail until tests are implemented
Coverage:
image: python:3.7
stage: test
coverage: '/TOTAL\s*\d*\s*\d*\s*(\d*)%/'
artifacts:
paths:
- PyStalk.log
- MetaStalk.log
- htmlcov/*
- bandit.json
allow_failure: true
before_script:
- pip install -U pip pipenv
- pip install -U pip coverage -r requirements.txt --quiet
- curl https://deepsource.io/cli | sh
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter; chmod +x ./cc-test-reporter; ./cc-test-reporter before-build
script:
- pipenv install --dev
- pipenv install coverage
- pipenv run coverage run -a --source . ./PyStalk.py ./utils/ExamplePhotos/ -t -d
- pipenv run coverage run -a --source . ./PyStalk.py ./utils/ExamplePhotos/Panasonic_DMC-FZ30.jpg ./utils/ExamplePhotos/DSCN0010.jpg -t -d
- pip install dist/*.whl
- coverage run -a --source . ./MetaStalk/main.py ./ExamplePhotos/ -t -d
- coverage run -a --source . ./MetaStalk/main.py ./ExamplePhotos/Panasonic_DMC-FZ30.jpg ./ExamplePhotos/DSCN0010.jpg -t -d
after_script:
- pipenv run coverage report
- pipenv run coverage html
- pipenv run coverage xml
- coverage report
- coverage html
- coverage xml
- ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml
- ./cc-test-reporter after-build
- bash <(curl -s https://codecov.io/bash)

.check:
stage: Code_Checking
.lint:
stage: lint
before_script:
- pip install -U pip pipenv
- pip install -U pip -r requirements.txt -r requirements-dev.txt --quiet
script:
- pipenv install --dev --skip-lock
- pipenv run pylint --ignored-classes=_socketobject PyStalk.py ./utils/ ./modules/
- pipenv run flake8 PyStalk.py ./utils/ ./modules/ --statistics --show-source
- pipenv run bandit -r -f json PyStalk.py ./utils/ ./modules/ > bandit.json
- time pipenv run python3 ./PyStalk.py ./utils/ExamplePhotos/ -d -t
- pylint --rcfile=tox.ini ./MetaStalk
- flake8 ./MetaStalk --statistics --show-source

python-3.6-lint:
extends: ".lint"
image: python:3.6

python-3.7-lint:
extends: ".lint"
image: python:3.7

python-3.8-lint:
extends: ".lint"
image: python:3.8


.build:
stage: test
before_script:
- pip install -U setuptools twine --quiet
script:
- python setup.py sdist bdist_wheel
- python -m twine check dist/*

python-3.6-build:
extends: ".build"
image: python:3.6
artifacts:
paths:
- bandit.json
- dist/

python-3.7-build:
extends: ".build"
image: python:3.7
artifacts:
paths:
- dist/

python-3.5:
extends: ".check"
image: python:3.5
python-3.8-build:
extends: ".build"
image: python:3.8
artifacts:
paths:
- dist/

python-3.6:
extends: ".check"
.test:
stage: Test_Build
before_script:
- pip install -U pip --quiet
script:
- pip install dist/*.whl
- pip show -f metastalk
- command -v metastalk
- metastalk ./ExamplePhotos/ -t -d
- metastalk ./ExamplePhotos/Panasonic_DMC-FZ30.jpg ./ExamplePhotos/DSCN0010.jpg -t -d

python-3.6-test:
extends: ".test"
image: python:3.6

python-3.7:
extends: ".check"
python-3.7-test:
extends: ".test"
image: python:3.7

python-3.8:
extends: ".check"
image: python:3.8
python-3.8-test:
extends: ".test"
image: python:3.8


Deploy_to_PyPi:
image: python:3.7
stage: Deploy_to_PyPi
variables:
TWINE_USERNAME: $PRODUCTION_USERNAME
TWINE_PASSWORD: $PRODUCTION_PASSWORD
before_script:
- pip install -U pip setuptools twine --quiet
script:
- python setup.py sdist bdist_wheel
- python -m twine check dist/*
- python -m twine upload --verbose --username $PRODUCTION_USER --password $PRODUCTION_PASSWORD dist/*
only:
refs:
- tags
- master
variables:
- $CI_COMMIT_TAG

15 changes: 0 additions & 15 deletions .pylintrc

This file was deleted.

24 changes: 19 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,34 @@

<!-- markdownlint-disable MD024 -->

## [N/A] - UNRELEASED
## [v2.0.0] - UNRELEASED

All backend changes. No changes to PyStalk itself.
## Rename to MetaStalk

## Added
Rename to MetaStalk to create PyPi package and a lot backend development changes.

### Added

- License scanning
- [Codecov](https://codecov.io/gl/Cyb3r-Jak3/pystalk)
- Pipfile and Pipfile.lock for pipenv
- Pipfile and Pipfile.lock for pipenv.
- Added .gitlab folder for service desk.
- setup.py for pypi.

### Changed

- Reverted dependency scanner to default template.
- Name from PyStalk to MetaStalk as PyStalk is taken.
- Moved all files to MetaStalk directory.
- Moved ExamplePhotos to own directory.
- License scanning now only on master branch and tags.
- Can only run on from package.

### Removed

- Dropped support for Python 3.5 as hachoir does not support it.
- Dropped using pipenv for pipeline.
- Markdownlint check in codeclimate.

## [v1.4] - 2020-02-02

Expand All @@ -25,7 +39,7 @@ All backend changes. No changes to PyStalk itself.

### Removed

- Removed Flash Chart (library does not support it.)
- Removed Flash Chart (hachoir does not support it).

## [v1.3.3] - 2020-01-10

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 2 additions & 0 deletions Manifest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
graft MetaStalk/utils/assets
prune MetaStalk/tests
6 changes: 6 additions & 0 deletions MetaStalk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""MetaStalk
---
MetaStalk is a program that parse image metadata and creates charts from it.
"""
__version__ = "v2.0.0"
__author__ = "Cyb3r Jak3"
Loading

0 comments on commit b33fcc7

Please sign in to comment.