diff --git a/CHANGES.rst b/CHANGES.rst index 52945df..9e8a888 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,4 +1,4 @@ -21.x (2021-xx-xx) +21.8 (2021-08-03) ----------------- - Initial Release diff --git a/MANIFEST.in b/MANIFEST.in index 71314e3..407adfa 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,10 @@ -include LICENSE README.rst LICENSE tox.ini +include LICENSE README.rst CHANGES.rst tox.ini +recursive-include docs * recursive-include tests * recursive-include xsdata_attrs * +prune docs/_build +exclude .readthedocs.yml exclude .pre-commit-config.yaml global-exclude .DS_Store *.pyc diff --git a/README.rst b/README.rst index e83e2b6..0cd6947 100644 --- a/README.rst +++ b/README.rst @@ -55,6 +55,30 @@ Generate Models Generating package: init Generating package: generated.rss +.. code-block:: python + + ... + + @attr.s + class Rss: + class Meta: + name = "rss" + + version: Optional[float] = attr.ib( + default=None, + metadata={ + "type": "Attribute", + } + ) + channel: Optional[Channel] = attr.ib( + default=None, + metadata={ + "type": "Element", + } + ) + + ... + XML Parsing =========== diff --git a/docs/conf.py b/docs/conf.py index a85a97f..090d730 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -8,17 +8,18 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) -# -- Project information ----------------------------------------------------- +import os +import sys +from importlib import metadata + +sys.path.insert(0, os.path.abspath("..")) project = "xsdata-attrs" copyright = "2021, Christodoulos Tsoulloftas" author = "Christodoulos Tsoulloftas" # The full version, including alpha/beta/rc tags -release = "21.7" +version = release = metadata.version("xsdata-attrs") # -- General configuration --------------------------------------------------- diff --git a/docs/installation.rst b/docs/installation.rst index 4179ff6..0e286d3 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -8,18 +8,20 @@ The recommended method is to use a virtual environment. .. code-block:: console - $ pip install xsdata-attrs[cli] + $ pip install xsdata-attrs[cli,lxml,soap] .. hint:: - Install the cli requirements for the code generator + - Install the soap requirements for the builtin wsdl client + - Install lxml if you want to use one of the lxml handlers/writers instead of + the builtin python xml implementations. -In order to use the latest updates you can also -install directly from the git repo. +In order to use the latest updates you can also install directly from the git repo. .. code-block:: console - $ pip install git+https://github.com/tefra/xsdata-attrs@master#egg=xsdata[cli] + $ pip install git+https://github.com/tefra/xsdata-attrs@master#egg=xsdata-attrs[cli] Install using conda diff --git a/setup.cfg b/setup.cfg index 4e49576..c511e51 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = xsdata_attrs -version = 21.8 +version = attr: xsdata_attrs.__version__ description = xsdata attrs plugin long_description = file: README.rst long_description_content_type = text/x-rst diff --git a/tox.ini b/tox.ini index b88c301..55270c6 100644 --- a/tox.ini +++ b/tox.ini @@ -5,3 +5,41 @@ skip_missing_interpreters = true [testenv] extras = test,cli commands = pytest {posargs} + +[testenv:docs] +basepython = python3.8 +extras = docs,cli +changedir = docs +commands = + sphinx-build -b html . _build + +[testenv:build] +basepython = python3 +skip_install = true +deps = + wheel + setuptools + twine +whitelist_externals = rm +commands = + rm -fr dist + python setup.py bdist_wheel sdist + twine check dist/* + +[testenv:release] +basepython = python3 +skip_install = true +deps = {[testenv:build]deps} +commands_pre = + {[testenv:build]commands} +commands = + twine upload --skip-existing dist/* + +[testenv:testrelease] +basepython = python3 +skip_install = true +deps = {[testenv:build]deps} +commands_pre = + {[testenv:build]commands} +commands = + twine upload --repository-url https://test.pypi.org/legacy/ --skip-existing dist/* diff --git a/xsdata_attrs/__init__.py b/xsdata_attrs/__init__.py index e69de29..8f38e5b 100644 --- a/xsdata_attrs/__init__.py +++ b/xsdata_attrs/__init__.py @@ -0,0 +1 @@ +__version__ = "21.8"