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

Replace setup and requirements files with pyproject.toml #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
19 changes: 16 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -137,22 +137,26 @@ Example project

To play with the example project, just clone the repository and run the dev server.

`Install poetry <https://python-poetry.org/docs/#installation>`_ if not already installed.

.. code:: bash

$ git clone https://github.com/izimobil/django-rest-framework-datatables.git
$ cd django-rest-framework-datatables
$ pip install -r requirements-dev.txt
$ poetry install --with dev
$ python example/manage.py runserver
$ firefox http://127.0.0.1:8000

Testing
-------

`Install poetry <https://python-poetry.org/docs/#installation>`_ if not already installed.

Install development requirements.

.. code:: bash

$ pip install -r requirements-dev.txt
$ poetry install --with dev

Run the tests.

@@ -184,7 +188,7 @@ To build the documentation, you’ll need to install ``sphinx``.

.. code:: bash

$ pip install -r requirements-docs.txt
$ poetry install --with docs

To build the documentation:

@@ -193,6 +197,15 @@ To build the documentation:
$ cd docs
$ make clean && make html

Publish to PyPI
---------------

`Build <https://python-poetry.org/docs/cli/#build>`_ package and `Publish <https://python-poetry.org/docs/cli/#publish>`_ to PyPI with two commands.

.. code:: bash

$ poetry build
$ poetry publish

.. _tox: http://tox.readthedocs.org/en/latest/

2 changes: 1 addition & 1 deletion docs/tutorial.rst
Original file line number Diff line number Diff line change
@@ -203,7 +203,7 @@ In the above example, the fields 'id' and 'rank' will always be serialized in th

Alternatively, if you wish to choose which fields to preserve at runtime rather than hardcoding them into your serializer models, use the ``?keep=`` param along with the fields you wish to maintain (comma separated). For example, if you wished to preserve ``id`` and ``rank`` as before, you would simply use the following API call:

.. code:: html
.. code::

data-ajax="/api/albums/?format=datatables&keep=id,rank"

62 changes: 62 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[tool.poetry]
name = "djangorestframework-datatables"
version = "0.7.1"
description = "Seamless integration between Django REST framework and Datatables (https://datatables.net)"
authors = ["David Jean Louis <izimobil@gmail.com>"]
license = "MIT"
readme = ["README.rst", "docs/changelog.rst"]
packages = [
{ include = "rest_framework_datatables" },
{ include = "rest_framework_datatables/django_filters" },
]
homepage = "https://github.com/izimobil/django-rest-framework-datatables"
repository = "https://github.com/izimobil/django-rest-framework-datatables"
keywords = ["django",]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"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 :: 3 :: Only",
"Topic :: Internet :: WWW/HTTP",
]

[tool.poetry.dependencies]
python = ">=3.7"
djangorestframework = ">=3.14.0"
pytz = ">=2019.1"

[tool.poetry.group.dev]
optional = true

[tool.poetry.group.dev.dependencies]
coverage = "==6.5.0"
Django = ">=3.2"
pycodestyle = ">=2.9.1"
django-filter = ">=22.1"

[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
Sphinx = "==5.3.0"
sphinx-rtd-theme = "==1.1.1"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

6 changes: 0 additions & 6 deletions requirements-dev.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements-docs.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

1 change: 0 additions & 1 deletion rest_framework_datatables/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
__version__ = '0.7.0'
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

112 changes: 0 additions & 112 deletions setup.py

This file was deleted.