From 737d17f3312e0375f93a082263af5411282c785c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ma=C5=9Blanka?= <piotr.maslanka@ericsson.com> Date: Fri, 2 Aug 2024 11:38:33 +0200 Subject: [PATCH] fix --- .github/workflows/main.yml | 41 ----------------- .gitignore | 3 ++ .gitlab-ci.yml | 91 ++++++++++++++++++++++++++++++++++++++ docs/changelog.rst | 5 +++ setup.cfg | 6 +-- setup.py | 4 +- 6 files changed, 104 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/main.yml create mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index eb0ac55..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: CI -run-name: ${{ github.actor }} -on: [ push ] -jobs: - tests: - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ] - steps: - - uses: actions/checkout@main - - uses: actions/setup-python@main - with: - python-version: ${{ matrix.python-version }} - cache: pip - - name: Install everything - run: | - sudo apt-get update - sudo apt-get install -y python3-setuptools python3-yaml python3-dev - pip install -U pip pytest coverage pytest-cov Cython setuptools - - name: Before the coverage - run: | - wget https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 - chmod ugo+x test-reporter-latest-linux-amd64 - ./test-reporter-latest-linux-amd64 before-build - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - - name: Test - run: | - python setup.py install - pytest -vv --cov=minijson - env: - DEBUG: '1' - - name: Submit the code coverage - run: | - coverage xml - ./test-reporter-latest-linux-amd64 after-build -t coverage.py - ./test-reporter-latest-linux-amd64 format-coverage -t coverage.py -o codeclimate.json - ./test-reporter-latest-linux-amd64 upload-coverage -i codeclimate.json - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 239222d..40fa5fb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ __pycache__/ # Distribution / packaging .Python build/ +*.egg-info +minijson.c +docs/_build/ develop-eggs/ dist/ downloads/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..d20b509 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,91 @@ +stages: + - test + - build + +pages: + stage: build + image: zoo.smok.co/build/build:pages + before_script: + - pip install --upgrade Cython setuptools pip + - pip install -r requirements.txt + - python setup.py build_ext --inplace + script: + - cd docs + - make html + - cp _build/html public + artifacts: + paths: + - "public" + +.test_python: + stage: test + before_script: + - pip install --upgrade Cython setuptools pip coverage nose2 + - pip install -r requirements.txt + - python setup.py build_ext --inplace + variables: + CI: "1" + script: + - python -m coverage run -m nose2 -vv -F + - python -m coverage report + coverage: /TOTAL.*\s+(\d+\%)/ + + +test_python38: + extends: .test_python + image: python:3.8 + + + +test_python39: + extends: .test_python + image: python:3.9 + + +test_python310: + extends: .test_python + image: python:3.10 + + + +test_python311: + extends: .test_python + image: python:3.11 + + +.build_python: + only: + - master + stage: build + script: + - pip install --break-system-packages --upgrade Cython setuptools pip + - pip install --break-system-packages -r requirements.txt + - python setup.py bdist_wheel + - cp dist/*.whl . + artifacts: + paths: + - "*.whl" + + +build_python38: + extends: .build_python + image: python:3.8 + +build_python39: + extends: .build_python + image: python:3.9 + + +build_python310: + extends: .build_python + image: python:3.10 + + +build_python311: + extends: .build_python + image: python:3.11 + + +build_python311_armv7l: + extends: .build_python + image: zoo.smok.co/build/build:armv7l-python311 diff --git a/docs/changelog.rst b/docs/changelog.rst index 3757558..aa8ddea 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Changelog ========= +v3.1.0 +------ + +Moved entirely to SMOKs' build architecture. + v3.0.1 ------ diff --git a/setup.cfg b/setup.cfg index 07163fb..bf14196 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ # coding: utf-8 [metadata] -version = 3.0.1 +version = 3.1.0 name = minijson long_description = file: README.md long_description_content_type = text/markdown; charset=UTF-8 @@ -12,8 +12,8 @@ description = A library for serializing JSON in a small binary format url = https://github.com/smok-serwis/minijson project_urls = Documentation = https://minijson.readthedocs.io/ - Code = https://github.com/smok-serwis/minijson - Issue tracker = https://github.com/smok-serwis/minijson/issues + Code = https://git.dms-serwis.com.pl/smokserwis/minijson + Issue tracker = https://git.dms-serwis.com.pl/smokserwis/minijson/-/issues classifier = Development Status :: 5 - Production/Stable Programming Language :: Python diff --git a/setup.py b/setup.py index d1ce8c0..0c145e1 100644 --- a/setup.py +++ b/setup.py @@ -10,12 +10,12 @@ from setuptools import setup, Extension directive_defaults = get_directive_defaults() directive_defaults['language_level'] = '3' macros = [] -if 'DEBUG' in os.environ: +if 'DEBUG' in os.environ or 'CI' in os.environ: print('Enabling debug mode') directive_defaults['linetrace'] = True directive_defaults['profiling'] = True directive_defaults['binding'] = True - macros = [('CYTHON_TRACE', '1')] + macros = [('CYTHON_TRACE', '1'), ('CYTHON_TRACE_NOGIL', '1')] setup(ext_modules=cythonize([Extension("minijson", ["minijson.pyx"], define_macros=macros)])) -- GitLab