diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7b1de7..48c0c61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: pip - cache-dependency-path: setup.py + cache-dependency-path: setup.cfg - run: pip install .[test] # Print the ijson backend, to make any errors easier to debug. - run: python -c "import ijson; print(ijson.backend)" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 66d0e91..eb4b111 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,10 +12,10 @@ jobs: with: python-version: 3.8 cache: pip - cache-dependency-path: setup.py + cache-dependency-path: setup.cfg - run: curl -s -S --retry 3 $BASEDIR/tests/install.sh | bash - - run: curl -s -S --retry 3 $BASEDIR/tests/script.sh | bash - - run: pip install .[test] - run: pytest /tmp/test_requirements.py - - run: pip install --upgrade check-manifest setuptools + - run: pip install --upgrade check-manifest - run: check-manifest diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9301126..09a0405 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -8,8 +8,8 @@ jobs: - uses: actions/setup-python@v4 with: python-version: 3.8 - - run: pip install --upgrade setuptools wheel - - run: python setup.py sdist bdist_wheel + - run: pip install --upgrade build + - run: python -m build --sdist --wheel - name: Publish to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/pyproject.toml b/pyproject.toml index 6da1ddf..2b00077 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["setuptools>=61.2"] +build-backend = "setuptools.build_meta" + [tool.pylint.BASIC] good-names = 'e,f,i,n,io' # exception, file, enumerate, number diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..26cc72c --- /dev/null +++ b/setup.cfg @@ -0,0 +1,50 @@ +[metadata] +name = ocdskit +version = 1.1.3 +author = Open Contracting Partnership +author_email = data@open-contracting.org +license = BSD +description = A suite of command-line tools for working with OCDS data +url = https://github.com/open-contracting/ocdskit +long_description = file: README.rst +classifiers = + License :: OSI Approved :: BSD License + Operating System :: OS Independent + 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 + Programming Language :: Python :: Implementation :: PyPy + +[options] +packages = find: +install_requires = + ijson>=2.5 + jsonref + ocdsmerge>=0.6 + ocdsextensionregistry>=0.1.2 + +[options.packages.find] +exclude = + tests + tests.* + +[options.entry_points] +console_scripts = + ocdskit = ocdskit.__main__:main + +[options.extras_require] +perf = + orjson>=3 +test = + coveralls + jsonpointer + pytest + pytest-cov + pytest-vcr +docs = + furo + sphinx + sphinx-autobuild diff --git a/setup.py b/setup.py deleted file mode 100644 index 9e095dc..0000000 --- a/setup.py +++ /dev/null @@ -1,56 +0,0 @@ -from setuptools import find_packages, setup - -with open('README.rst') as f: - long_description = f.read() - -setup( - name='ocdskit', - version='1.1.3', - author='Open Contracting Partnership', - author_email='data@open-contracting.org', - url='https://github.com/open-contracting/ocdskit', - description='A suite of command-line tools for working with OCDS data', - license='BSD', - packages=find_packages(exclude=['tests', 'tests.*']), - long_description=long_description, - long_description_content_type='text/x-rst', - install_requires=[ - 'ijson>=2.5', - 'jsonref', - 'ocdsmerge>=0.6', - 'ocdsextensionregistry>=0.1.2', - ], - extras_require={ - 'perf': [ - 'orjson>=3', - ], - 'test': [ - 'coveralls', - 'jsonpointer', - 'pytest', - 'pytest-cov', - 'pytest-vcr', - ], - 'docs': [ - 'furo', - 'sphinx', - 'sphinx-autobuild', - ], - }, - classifiers=[ - 'License :: OSI Approved :: BSD License', - 'Operating System :: OS Independent', - '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', - 'Programming Language :: Python :: Implementation :: PyPy', - ], - entry_points={ - 'console_scripts': [ - 'ocdskit = ocdskit.__main__:main', - ], - }, -)