diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 62b61057e8914c1b737cff0b15dae5c4750f8795..0000000000000000000000000000000000000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,33 +0,0 @@ -engines: - duplication: - enabled: true - config: - languages: - python: - - fixme: - enabled: true - markdownlint: - enabled: true - pep8: - enabled: true -exclude_paths: - - tests/** - - setup.py -ratings: - paths: - - flask_minijson.py -checks: - argument-count: - config: - threshold: 15 - method-complexity: - config: - threshold: 50 - method-count: - config: - threshold: 85 - file-lines: - enabled: true - config: - threshold: 700 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..825d36e70d7d20a99298214c9a1b54380c886a15 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,41 @@ + +.test: + stage: test + before_script: + - pip install --break-system-packages --upgrade pytest setuptools pip coverage nose2 + - pip install ".[dev,test]" + script: + - pytest -n 8 -vv --cov=satella + - coverage xml + - coverage report + coverage: /TOTAL.*\s+(\d+\%)/ + +test_python37: + extends: .test + image: python:3.7 + +test_python38: + extends: .test + image: python:3.8 + +test_python39: + extends: .test + image: python:3.9 + + +build_python: + stage: build + before_script: + - pip install --break-system-packages --upgrade Cython setuptools pip twine + script: + - python setup.py bdist_wheel + - mv dist/*.whl . + artifacts: + paths: + - "*.whl" + after_script: + - TWINE_PASSWORD=${CI_JOB_TOKEN} TWINE_USERNAME=gitlab-ci-token python3 -m twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi *.whl + only: + - tags + except: + - branches diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9b054a7fb2b375da78143ec72b80f639db03f149..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -language: python -stages: - - name: test - -cache: pip -before_script: - - 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 - - pip install -r requirements.txt - - pip install -U pytest-xdist pytest-cov pytest pytest-forked pluggy py - - python setup.py install -jobs: - include: - - stage: test - python: "3.5" - script: - - pytest -n 8 --cov=flask_minijson - after_script: - - coverage xml - - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - - stage: test - python: "3.6" - script: - - pytest -n 8 --cov=flask_minijson - after_script: - - coverage xml - - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - - stage: test - python: "3.7" - script: - - pytest -n 8 --cov=flask_minijson - after_script: - - coverage xml - - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - - stage: test - python: "3.8" - script: - - pytest -n 8 --cov=flask_minijson - after_script: - - coverage xml - - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - - stage: test - python: "3.9" - script: - - pytest -n 8 --cov=flask_minijson - after_script: - - coverage xml - - ./cc-test-reporter after-build -t coverage.py --exit-code $TRAVIS_TEST_RESULT - diff --git a/LICENSE b/LICENSE index f71070cea47a3c12ecd24366932cfd6ef01b143a..6a5437b6b4fc894642243c7fa06fbdc5774eb927 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ MIT License Copyright (c) 2021 Dronehub Group sp. z o. o. -Copyright (c) 2024 Piotr MaĹlanka +Copyright (c) 2024 SMOK sp. z o. o. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/setup.cfg b/setup.cfg index a8781f7505d2958f3a955138e9d74dab7a77db9f..83e9cbf6446bab21da786d0ebe97417d8aef2ccb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ # coding: utf-8 [metadata] -version = 0.4 +version = 0.5 name = flask-minijson long_description = file: README.md long_description_content_type = text/markdown; charset=UTF-8 diff --git a/tests/test_minijson.py b/tests/test_minijson.py index b2fa4222d724ef272573114767bddc5d22ebf4e6..b66bfd2718b1d6ca29968975870a7831e1ef99a8 100644 --- a/tests/test_minijson.py +++ b/tests/test_minijson.py @@ -11,9 +11,9 @@ class TestMiniJSON(unittest.TestCase): def test_minijson(self): data = minijson.dumps({'1': '2'}) - resp = self.client.post('/v1', data=data, headers={'Content-Type': 'application/x-minijson'}) + resp = self.client.post('/v1', data=data, headers={'Accept': 'application/x-minijson'}) self.assertEqual(resp.get_json(), {'status': 'ok'}) - resp = self.client.post('/v1', data=data, headers={'Content-Type': 'application/minijson'}) + resp = self.client.post('/v1', data=data, headers={'Accept': 'application/minijson'}) self.assertEqual(resp.get_json(), {'status': 'ok'}) resp = self.client.post('/v1', json={'1': '3'}) self.assertEqual(resp.get_json(), {'status': 'fail'})