diff --git a/.github/workflows/release-python.yml b/.github/workflows/release-python.yml index 691b9ef..cb96c2d 100644 --- a/.github/workflows/release-python.yml +++ b/.github/workflows/release-python.yml @@ -26,10 +26,10 @@ jobs: env: CIBW_ARCHS_MACOS: x86_64 universal2 CIBW_TEST_SKIP: '*universal2:arm64' - CIBW_BUILD: "cp36-macosx_x86_64 cp38-macosx_universal2 cp36-win* cp36-manylinux_{x86_64,i686}" + CIBW_BUILD: "cp37-macosx_x86_64 cp38-macosx_universal2 cp37-win* cp37-manylinux_{x86_64,i686}" - uses: actions/upload-artifact@v2 with: - name: python_bsonjs-3.6-${{ matrix.os }}-wheel + name: python_bsonjs-3.7-${{ matrix.os }}-wheel path: ./wheelhouse/*.whl if-no-files-found: error test-non-linux-wheels: @@ -38,17 +38,18 @@ jobs: strategy: matrix: os: [macos-latest, windows-2019] - python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] name: Test CPython ${{ matrix.python-version }}-${{ matrix.os }} steps: - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Download a previously created wheel uses: actions/download-artifact@v2 with: - name: python_bsonjs-3.6-${{ matrix.os }}-wheel + name: python_bsonjs-3.7-${{ matrix.os }}-wheel - name: Test wheel shell: bash run: | @@ -64,14 +65,14 @@ jobs: matrix: os: [ubuntu-latest] container: ['manylinux2014_i686', 'manylinux2014_x86_64'] - python-version: ['cp36-cp36m', 'cp37-cp37m', 'cp38-cp38', - 'cp39-cp39', 'cp310-cp310', 'cp311-cp311'] + python-version: ['cp37-cp37m', 'cp38-cp38', + 'cp39-cp39', 'cp310-cp310', 'cp311-cp311', 'cp312-cp312'] name: Test CPython ${{ matrix.python-version }}-${{ matrix.container }} steps: - name: Download a previously created wheel uses: actions/download-artifact@v2 with: - name: python_bsonjs-3.6-${{ matrix.os }}-wheel + name: python_bsonjs-3.7-${{ matrix.os }}-wheel - name: Test wheel run: | docker run --rm --volume `pwd`:/python quay.io/pypa/${{ matrix.container }} /bin/bash -c "/opt/python/${{ matrix.python-version }}/bin/python -m pip install -U pip && /opt/python/${{ matrix.python-version }}/bin/python -m pip install --find-links=/python/ --no-index python_bsonjs && /opt/python/${{ matrix.python-version }}/bin/python -m pip list | grep python-bsonjs && /opt/python/${{ matrix.python-version }}/bin/python -c 'from bsonjs import dumps'" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10275f0..e599350 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,20 +16,17 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, ubuntu-18.04, windows-2019] - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + os: [macos-latest, ubuntu-latest, windows-2019] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - # use pip rather than easy_install to install pymongo - - name: Install pymongo - run: | - python -m pip install pymongo + allow-prereleases: true - name: Test with python run: | - python -m pip install -e . -v - python setup.py test + python -m pip install -v -e ".[test]" + pytest diff --git a/README.rst b/README.rst index 7534282..1393674 100644 --- a/README.rst +++ b/README.rst @@ -110,7 +110,7 @@ like so Installing From Source ====================== -python-bsonjs supports CPython 3.6+. +python-bsonjs supports CPython 3.7+. Compiler ```````` @@ -119,7 +119,7 @@ You must build python-bsonjs separately for each version of Python. On Windows this means you must use the same C compiler your Python version was built with. -- Python 3.6 and up requires Microsoft Visual Studio 2015 +- Windows build requires Microsoft Visual Studio 2015 Source `````` @@ -133,12 +133,12 @@ Install Once you have the source properly downloaded, build and install the package:: - $ python setup.py install + $ pip install -v . Test ```` To run the test suite:: - $ python setup.py test + $ python -m pytest diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..b5c6afd --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,42 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "python-bsonjs" +version = "0.3.0" +description = "A library for converting between BSON and JSON." +readme = "README.rst" +license = { file = "LICENSE" } +requires-python = ">=3.7" +authors = [ + { name = "Shane Harvey", email = "shane.harvey@mongodb.com" }, +] +keywords = [ + "BSON", + "JSON", + "PyMongo", +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] + +[project.urls] +Homepage = "https://github.com/mongodb-labs/python-bsonjs" + +[project.optional-dependencies] +test = ["pymongo>=4", "pytest"] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6643eea..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -py-limited-api = cp36 diff --git a/setup.py b/setup.py index c097ea5..ca0da48 100644 --- a/setup.py +++ b/setup.py @@ -15,17 +15,8 @@ import glob import sys - from setuptools import setup, Extension -with open("README.rst") as f: - try: - description = f.read() - except Exception: - description = "" - -tests_require = ["pymongo>=3.4.0"] - libraries = [] if sys.platform == "win32": libraries.append("ws2_32") @@ -34,34 +25,6 @@ libraries.append("rt") setup( - name="python-bsonjs", - version="0.3.0", - description="A library for converting between BSON and JSON.", - long_description=description, - author="Shane Harvey", - author_email="shane.harvey@mongodb.com", - url="https://github.com/mongodb-labs/python-bsonjs", - keywords=["BSON", "JSON", "PyMongo"], - test_suite="test", - tests_require=tests_require, - license="Apache License, Version 2.0", - python_requires=">=3.6", - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Operating System :: MacOS :: MacOS X", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: Implementation :: CPython"], ext_modules=[ Extension( "bsonjs", @@ -75,5 +38,6 @@ ("Py_LIMITED_API", "0x03060000")], libraries=libraries ) - ] + ], + options={'bdist_wheel': {'py_limited_api': 'cp37'} } )