From 960eb917405b078cc50abffa73d9d0c24facde2b Mon Sep 17 00:00:00 2001 From: mutantsan Date: Thu, 24 Oct 2024 14:21:23 +0300 Subject: [PATCH] update doc and migrate to pyproject.ini --- README.md | 91 +++----------------------------------------------- pyproject.toml | 35 +++++++++++++++++++ setup.py | 91 +------------------------------------------------- 3 files changed, 40 insertions(+), 177 deletions(-) create mode 100644 pyproject.toml diff --git a/README.md b/README.md index db39e04..33a811e 100644 --- a/README.md +++ b/README.md @@ -1,71 +1,21 @@ -[![Tests](https://github.com/mutantsan/ckanext-latex/workflows/Tests/badge.svg?branch=main)](https://github.com/mutantsan/ckanext-latex/actions) - # ckanext-latex -**TODO:** Put a description of your extension here: What does it do? What features does it have? Consider including some screenshots or embedding a video! - +Adds LaTEX scheming display and form snippets for CKAN forms. ## Requirements -**TODO:** For example, you might want to mention here which versions of CKAN this -extension works with. - -If your extension works across different versions you can add the following table: - -Compatibility with core CKAN versions: - | CKAN version | Compatible? | | --------------- | ------------- | | 2.6 and earlier | not tested | | 2.7 | not tested | | 2.8 | not tested | -| 2.9 | not tested | - -Suggested values: - -* "yes" -* "not tested" - I can't think of a reason why it wouldn't work -* "not yet" - there is an intention to get it working -* "no" - +| 2.9 | yes | ## Installation -**TODO:** Add any additional install steps to the list below. - For example installing any non-Python dependencies or adding any required - config settings. - -To install ckanext-latex: - -1. Activate your CKAN virtual environment, for example: - - . /usr/lib/ckan/default/bin/activate - -2. Clone the source and install it on the virtualenv - - git clone https://github.com/mutantsan/ckanext-latex.git - cd ckanext-latex - pip install -e . - pip install -r requirements.txt - -3. Add `latex` to the `ckan.plugins` setting in your CKAN - config file (by default the config file is located at - `/etc/ckan/default/ckan.ini`). - -4. Restart CKAN. For example if you've deployed CKAN with Apache on Ubuntu: - - sudo service apache2 reload - +Use pypi to install the package: -## Config settings - -None at present - -**TODO:** Document any optional config settings here. For example: - - # The minimum number of hours to wait before re-checking a resource - # (optional, default: 24). - ckanext.latex.some_setting = some_default_value + pip install ckanext-latex ## Developer installation @@ -85,39 +35,6 @@ To run the tests, do: pytest --ckan-ini=test.ini - -## Releasing a new version of ckanext-latex - -If ckanext-latex should be available on PyPI you can follow these steps to publish a new version: - -1. Update the version number in the `setup.py` file. See [PEP 440](http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers) for how to choose version numbers. - -2. Make sure you have the latest version of necessary packages: - - pip install --upgrade setuptools wheel twine - -3. Create a source and binary distributions of the new version: - - python setup.py sdist bdist_wheel && twine check dist/* - - Fix any errors you get. - -4. Upload the source distribution to PyPI: - - twine upload dist/* - -5. Commit any outstanding changes: - - git commit -a - git push - -6. Tag the new release of the project on GitHub with the version number from - the `setup.py` file. For example if the version number in `setup.py` is - 0.0.1 then do: - - git tag 0.0.1 - git push --tags - ## License [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html) diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..ec0b777 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,35 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "ckanext-latex" +description = "LaTeX syntax support for form and display" +version = "1.0.0" +keywords = [] + +authors = [ + {name = "DataShades", email = "datashades@linkdigital.com.au"}, + {name = "Oleksandr Cherniavskyi", email = "mutantsan@gmail.com"}, +] +maintainers = [ + {name = "DataShades", email = "datashades@linkdigital.com.au"}, +] + +readme = "README.md" +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", + "Operating System :: OS Independent", +] + +[project.optional-dependencies] +test = ["pytest-ckan", "ckanext-toolbelt", "requests-mock"] +dev = ["pytest-ckan", "ckanext-toolbelt", "requests-mock"] + +[project.urls] +Homepage = "https://github.com/DataShades/ckanext-latex" + +[project.entry-points."ckan.plugins"] +charts_view = "ckanext.latex.plugin:LatexPlugin" diff --git a/setup.py b/setup.py index 52e0b7e..53f3e74 100644 --- a/setup.py +++ b/setup.py @@ -1,95 +1,6 @@ -# -*- coding: utf-8 -*- -# Always prefer setuptools over distutils -from setuptools import setup, find_packages -from codecs import open # To use a consistent encoding -from os import path - -here = path.abspath(path.dirname(__file__)) - -# Get the long description from the relevant file -with open(path.join(here, 'README.md'), encoding='utf-8') as f: - long_description = f.read() +from setuptools import setup setup( - name='''ckanext-latex''', - - # Versions should comply with PEP440. For a discussion on single-sourcing - # the version across setup.py and the project code, see - # http://packaging.python.org/en/latest/tutorial.html#version - version='0.0.1', - - description='''LaTeX syntax support for form and display''', - long_description=long_description, - long_description_content_type="text/markdown", - - # The project's main homepage. - url='https://github.com/mutantsan/ckanext-latex', - - # Author details - author='''Alexandr Cherniavskyi''', - author_email='''mutantsan@gmail.com''', - - # Choose your license - license='AGPL', - - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - # How mature is this project? Common values are - # 3 - Alpha - # 4 - Beta - # 5 - Production/Stable - 'Development Status :: 4 - Beta', - - # Pick your license as you wish (should match "license" above) - 'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)', - - # Specify the Python versions you support here. In particular, ensure - # that you indicate whether you support Python 2, Python 3 or both. - 'Programming Language :: Python :: 2.7', - ], - - - # What does your project relate to? - keywords='''CKAN''', - - # You can just specify the packages manually here if your project is - # simple. Or you can use find_packages(). - packages=find_packages(exclude=['contrib', 'docs', 'tests*']), - namespace_packages=['ckanext'], - - install_requires=[ - # CKAN extensions should not list dependencies here, but in a separate - # ``requirements.txt`` file. - # - # http://docs.ckan.org/en/latest/extensions/best-practices.html - # add-third-party-libraries-to-requirements-txt - ], - - # If there are data files included in your packages that need to be - # installed, specify them here. If using Python 2.6 or less, then these - # have to be included in MANIFEST.in as well. - include_package_data=True, - package_data={ - }, - - # Although 'package_data' is the preferred approach, in some case you may - # need to place data files outside of your packages. - # see http://docs.python.org/3.4/distutils/setupscript.html - # installing-additional-files - # In this case, 'data_file' will be installed into '/my_data' - data_files=[], - - # To provide executable scripts, use entry points in preference to the - # "scripts" keyword. Entry points provide cross-platform support and allow - # pip to create the appropriate form of executable for the target platform. - entry_points=''' - [ckan.plugins] - latex=ckanext.latex.plugin:LatexPlugin - - [babel.extractors] - ckan = ckan.lib.extract:extract_ckan - ''', - # If you are changing from the default layout of your extension, you may # have to change the message extractors, you can read more about babel # message extraction at