alan-turing-institute / PeriPy

Code base for PeriPy, a lightweight, open-source and high-performance package for peridynamic simulations written in Python - a collaboration between Exeter, Cambridge & Turing
MIT License
46 stars 14 forks source link

Upload sphinx documentation to PyPI #75

Closed bb515 closed 4 years ago

bb515 commented 4 years ago

Documentation should look something like, for example: https://pypi.org/project/dictionaries/

Following this tutorial, I get the error (listed below), and couldn't find any information on it on stack overflow etc. https://pythonhosted.org/an_example_pypi_project/buildanduploadsphinx.html more info about the package: https://pypi.org/project/Sphinx-PyPI-upload/0.2.1/

python setup.py upload_sphinx

Traceback (most recent call last):
  File "setup.py", line 56, in <module>
    'sklearn'
  File "C:\Anaconda3\lib\site-packages\setuptools\__init__.py", line 161, in setup
    return distutils.core.setup(**attrs)
  File "C:\Anaconda3\lib\distutils\core.py", line 134, in setup
    ok = dist.parse_command_line()
  File "C:\Anaconda3\lib\distutils\dist.py", line 483, in parse_command_line
    args = self._parse_command_opts(parser, args)
  File "C:\Anaconda3\lib\site-packages\setuptools\dist.py", line 925, in _parse_command_opts
    nargs = _Distribution._parse_command_opts(self, parser, args)
  File "C:\Anaconda3\lib\distutils\dist.py", line 539, in _parse_command_opts
    cmd_class = self.get_command_class(command)
  File "C:\Anaconda3\lib\site-packages\setuptools\dist.py", line 764, in get_command_class
    self.cmdclass[command] = cmdclass = ep.load()
  File "C:\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 2462, in load
    return self.resolve()
  File "C:\Anaconda3\lib\site-packages\pkg_resources\__init__.py", line 2468, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "C:\Anaconda3\lib\site-packages\sphinx_pypi_upload.py", line 61
    raise DistutilsOptionError, \
                              ^
SyntaxError: invalid syntax
bb515 commented 4 years ago

In order to upload documentation to a PyPI pacakage, you will first need to upload a test pacakage to PyPI. The steps are: In the branch feature/OpenCL_integrator_BB Generate docs In the docs directory cd ./docs Directory for the built documentation mkdir ./_build Clean any existing documentation that has been built make clean This will put html file documentation in ./docs/_build make html Follow the steps here https://realpython.com/pypi-publish-python-package/ They should already be complete up to the step https://realpython.com/pypi-publish-python-package/#publishing-to-pypi

bb515 commented 4 years ago

No luck with this, have decided to use readthedocs #76 as it seems much easier