Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve packaging #196

Merged
merged 7 commits into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MANAGEMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Then you have to [create a release](https://github.com/blog/1547-release-your-so

And then upload the release to pypi:

python setup.py register sdist --formats=gztar,zip bdist_egg upload
python setup.py sdist && twine upload dist/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should be uploading wheels also, but fine as is as it already improves on previous commands.


Please, don't forget to increment to the next module (`SPARQLWrapper/__init__.py` file).

Expand Down
7 changes: 3 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -825,10 +825,9 @@ The source distribution contains:
somewhere into your PYTHONPATH. Alternatively, you can also run
the distutils scripts: ``python setup.py install``

- ``test``: some unit and integrations tests. In order to run the tests
some packages have to be installed before. So please install the packages
listed in requirements.development.txt:
``pip install -r requirements.development.txt``
- ``test``: some unit and integrations tests. In order to run the tests
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly sure this is deprecated:

Maybe it is okay for now, but better to point people to tox if they want something easy to manage.

I'm somewhat okay with the change you made as is, because it makes it no worse, but this is something we have to fix sometime.

some packages have to be installed before. So please install the dev packages:
``pip install '.[dev]'``

- ``scripts``: some scripts to run the package against some SPARQL endpoints.

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["wheel", "setuptools"]
build-backend = "setuptools.build_meta"
51 changes: 51 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[metadata]
name = SPARQLWrapper
version = attr: SPARQLWrapper.__init__.__version__
description = SPARQL Endpoint interface to Python
long_description = This is a wrapper around a SPARQL service. It helps in creating the query URI and, possibly, convert the result into a more manageable format.
license = W3C SOFTWARE NOTICE AND LICENSE
author = attr: SPARQLWrapper.__init__.__authors__
author_email = attr: SPARQLWrapper.__init__.__contact__
url = attr: SPARQLWrapper.__init__.__url__
download_url = https://github.com/RDFLib/sparqlwrapper/releases
platforms =
any
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: W3C License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: Implementation :: CPython
Topic :: Software Development :: Libraries :: Python Modules
keywords =
python
sparql
rdf
rdflib
project_urls =
Home = https://rdflib.github.io/sparqlwrapper
Documentation = https://sparqlwrapper.readthedocs.io
Source = https://github.com/RDFLib/sparqlwrapper
Tracker = https://github.com/RDFLib/sparqlwrapper/issues

[options]
packages =
SPARQLWrapper
include_package_data = True
install_requires =
rdflib>=6.1.1
python_requires = >= 3.7

[options.extras_require]
dev =
setuptools>=3.7.1
keepalive =
keepalive>=0.5

[options.entry_points]
console_scripts =
rqw = SPARQLWrapper.main:main
75 changes: 1 addition & 74 deletions setup.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,76 +1,3 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup

# metadata
import re

_version_re = re.compile(r'__version__\s*=\s*"(.*)"')
_authors_re = re.compile(r'__authors__\s*=\s*"(.*)"')
_url_re = re.compile(r'__url__\s*=\s*"(.*)"')

for line in open('SPARQLWrapper/__init__.py'):

version_match = _version_re.match(line)
if version_match:
version = version_match.group(1)

authors_match = _authors_re.match(line)
if authors_match:
authors = authors_match.group(1)

url_match = _url_re.match(line)
if url_match:
url = url_match.group(1)

# requirements
with open('requirements.txt', 'r') as f:
_install_requires = [line.rstrip('\n') for line in f]

with open('requirements.development.txt', 'r') as f:
_install_dev_requires = [line.rstrip('\n') for line in f]

setup(
name='SPARQLWrapper',
version=version,
description='SPARQL Endpoint interface to Python',
long_description='This is a wrapper around a SPARQL service. It helps in creating the query URI and, possibly, '
'convert the result into a more manageable format.',
license='W3C SOFTWARE NOTICE AND LICENSE',
author=authors,
url=url,
download_url='https://github.com/RDFLib/sparqlwrapper/releases',
platforms=['any'],
python_requires='>=3.7',
packages=['SPARQLWrapper'],
install_requires=_install_requires,
extras_require={
'dev': _install_dev_requires,
'keepalive': ['keepalive>=0.5'],
},
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: W3C License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Libraries :: Python Modules',
],
keywords=['python', 'sparql', 'rdf', 'rdflib'],
project_urls={
'Home': 'https://rdflib.github.io/sparqlwrapper/',
'Documentation': 'https://sparqlwrapper.readthedocs.io',
'Source': 'https://github.com/RDFLib/sparqlwrapper',
'Tracker': 'https://github.com/RDFLib/sparqlwrapper/issues',
},
entry_points={
'console_scripts': [
'rqw=SPARQLWrapper.main:main'
]
}
)
setup()