Skip to content

Commit

Permalink
Update PyPI long description
Browse files Browse the repository at this point in the history
  • Loading branch information
JrGoodle committed Jun 28, 2020
1 parent 0bfb27d commit 1a6bc7b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 21 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Example files

README-processed.md

docs/examples/clowder.yml
docs/examples/.clowder
docs/examples/duke
Expand Down
24 changes: 12 additions & 12 deletions script/update_website_index.py → script/process_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@
from typing import List, Optional


if 'GH_PAGES_DIR' not in os.environ:
print('GH_PAGES_DIR not set')
exit(1)

gh_pages_dir = Path(os.environ['GH_PAGES_DIR'])
print(gh_pages_dir)
path = Path.cwd()
repo_dir = Path(__file__).parent.parent.absolute()


def main():
readme_path = path / 'README.md'
readme_path = repo_dir / 'README.md'
readme_contents = readme_path.read_text()
readme_contents = readme_contents.splitlines()
readme_contents = readme_contents[2:]

output = "\n".join(readme_contents)
output = output.replace('](CONTRIBUTING', '](https://github.com/JrGoodle/clowder/blob/master/CONTRIBUTING')

pattern = r'\]\(docs\/(.+?(?<!\.gif))\)'
matches = re.findall(pattern, output)
pattern = r'\]\(docs\/(.+?)\)'
# matches = re.findall(pattern, output)
replace = r'](https://github.com/JrGoodle/clowder/blob/master/docs/\1)'
output = re.sub(pattern, replace, output)

with open(str( gh_pages_dir / 'index.md'), "w") as text_file:
text_file.write(f"{output}\n")
output = output.replace('.gif)', '.gif?raw=true)')

processed_readme_path = repo_dir / 'README-processed.md'
if processed_readme_path.exists():
os.remove(str(processed_readme_path))

with open(str(processed_readme_path), "w") as output_file:
output_file.write(f"{output}\n")


main()
10 changes: 4 additions & 6 deletions script/update
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@ fi

if [ "$1" == 'website' ]; then
cd ..
export GH_PAGES_DIR
GH_PAGES_DIR="$( cd .. && pwd)/clowder-gh-pages"
rm -rf $GH_PAGES_DIR || exit 1
git clone git@github.com:JrGoodle/clowder.git -b gh-pages $GH_PAGES_DIR || exit 1

script/update_website_index.py
script/process_readme.py || exit 1

rm -rf "$GH_PAGES_DIR/docs/examples" || exit 1
cp -a 'docs/examples' "$GH_PAGES_DIR/docs/examples" || exit 1
rm -rf $GH_PAGES_DIR/docs/examples/*.yml || exit 1
rm -rf $GH_PAGES_DIR/docs/examples/*.sh || exit 1
INDEX_FILE="$GH_PAGES_DIR/index.md"
rm -f "$INDEX_FILE" || exit 1
mv 'README-processed.md' "$INDEX_FILE" || exit 1

# cd $GH_PAGES_DIR || exit 1
# git add index.md docs/README || exit 1
Expand Down
14 changes: 11 additions & 3 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@
Setup file for clowder
"""

from pathlib import Path
from setuptools import setup

# Written according to the docs at
# https://packaging.python.org/en/latest/distributing.html

repo_dir = Path(__file__).parent.parent.absolute()
process_readme_script = repo_dir / 'scripts' / 'process_readme.py'
exec(process_readme_script.read_text())
processed_readme = repo_dir / 'README-processed.md'
long_description = processed_readme.read_text()

setup(
name='clowder-repo',
description='A tool for managing code',
description='Utility for managing multiple git repositories',
long_description=long_description,
long_description_content_type='text/markdown',
version='4.0b3',
url='http://clowder.cat',
author='Joe DeCapo',
author_email='joe@polka.cat',
license='MIT',
classifiers=[
# 'Development Status :: 5 - Production/Stable',
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
Expand Down

0 comments on commit 1a6bc7b

Please sign in to comment.