Skip to content

Commit

Permalink
fixing install
Browse files Browse the repository at this point in the history
  • Loading branch information
choldgraf committed Dec 3, 2019
1 parent c64ada6 commit a43fe5e
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 24 deletions.
29 changes: 29 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Instructions for creating a new release

Spinx-Copybutton is [hosted on the pypi repository](https://pypi.org/project/sphinx-copybutton/).
To create a new release of Sphinx-Copybutton, you need to do these things:

## Before you start

1. Ensure that you have push access to the [Sphinx-Copybutton pypi repository](https://pypi.org/project/sphinx-copybutton/)
2. Install [the twine package](https://twine.readthedocs.io/en/latest/). This is a package that helps you
bundle and push new Python package distributions to pip.

## To create the release

To create a new release, [open an issue](https://github.com/choldgraf/sphinx-copybutton/issues/new) to keep
track of the to-do list for the release. Copy/paste the following markdown into the issue
and check off the boxes as you complete items:


```
- [ ] Ensure that the [Sphinx-Copybutton version number](https://github.com/choldgraf/sphinx-copybutton/blob/master/jupyter_book/__init__.py)
is correct, and remove the `dev0` part of the version number.
Make a PR with the new number and merge into master.
- [ ] Create a new distribution for Sphinx-Copybutton by
[following the twine release instructions](https://twine.readthedocs.io/en/latest/#using-twine)
- [ ] Confirm that the new version of Sphinx-Copybutton [is posted to pypi](https://pypi.org/project/sphinx-copybutton/)
- [ ] Bump the [Sphinx-Copybutton version number](https://github.com/choldgraf/sphinx-copybutton/blob/master/jupyter_book/__init__.py) to
the next minor (or major) release and append `dev0` to the end.
- [ ] Celebrate! You've just released a new version of Sphinx-Copybutton!
```
11 changes: 5 additions & 6 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Sphinx-copybutton
.. image:: https://readthedocs.org/projects/sphinx-copybutton/badge/?version=latest
:target: https://sphinx-copybutton.readthedocs.io/en/latest/?badge=latest
:alt: Documentation
.. image:: https://img.shields.io/pypi/v/sphinx-copybutton.svg

.. image:: https://img.shields.io/pypi/v/sphinx-copybutton.svg
:target: https://pypi.org/project/sphinx_copybutton
:alt: PyPi page

Expand Down Expand Up @@ -87,21 +87,21 @@ to something new. Follow these steps:
In it, put the following code:

.. code-block:: javascript
const updateCopyButtonImages = () => {
const copybuttonimages = document.querySelectorAll('a.copybtn img')
copybuttonimages.forEach((img, index) => {
img.setAttribute('src', 'path-to-new-image.svg')
})
}
runWhenDOMLoaded(updateCopyButtonImages)
2. Add this javascript file to your `conf.py` configuration like so:

.. code-block:: python
def setup(app):
app.add_javascript('js/custom.js');
Expand All @@ -128,4 +128,3 @@ pull to your computer and install locally with ``pip``::
:maxdepth: 1

second/second_page

16 changes: 0 additions & 16 deletions pyproject.toml

This file was deleted.

10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
from setuptools import setup, find_packages
from sphinx_copybutton import __version__

with open('./README.md', 'r') as ff:
readme_text = ff.read()

setup(
name='sphinx-copybutton',
version=__version__,
description="Add a copy button to each of your code cells.",
long_description=readme_text,
author='Chris Holdgraf',
author_email='choldgraf@gmail.com',
author_email='choldgraf@berkeley.edu',
url="https://github.com/choldgraf/sphinx-copybutton",
license='BSD',
packages=find_packages(),
package_data={'sphinx_copybutton': ['_static/copybutton.css',
'_static/copybutton.js',
'_static/copy-button.svg']},
include_package_data=True,
install_requires=["flit", "setuptools", "wheel", "sphinx"],
classifiers=["License :: OSI Approved :: MIT License"]
)
2 changes: 1 addition & 1 deletion sphinx_copybutton/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""A small sphinx extension to add "copy" buttons to code blocks."""
import os

__version__ = "0.2.6_dev"
__version__ = "0.2.6.dev0"

def scb_static_path(app):
static_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '_static'))
Expand Down

0 comments on commit a43fe5e

Please sign in to comment.