Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
namboy94 committed May 26, 2018
2 parents 9bca33e + 37da640 commit e7f5ae2
Show file tree
Hide file tree
Showing 35 changed files with 143 additions and 229 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
.idea/
*.iml
cover/
.coverage
*.egg-info/
dist/
build/
76 changes: 22 additions & 54 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,58 @@
stages:
- mirror
- test
- stats
- release
- docs

github_mirror:
stage: mirror
tags:
- github_namboy94_push
script:
- git checkout master && git pull
- git push git@github.com:namboy94/xdcc-dl.git master -f
- git checkout develop && git pull
- git push git@github.com:namboy94/xdcc-dl.git develop -f

stylecheck:
stage: test
tags:
- python3
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install pycodestyle
- pycodestyle . --exclude=virtual
- python3 -m venv virtual && source virtual/bin/activate && pip install ci-scripts
- python-codestyle-check

run_unit_tests_with_coverage:
unittest:
stage: test
tags:
- python3
- progstats-live
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install nose coverage
- python3 setup.py nosetests -v --with-coverage --cover-package=xdcc_dl --cover-branches --cover-erase --cover-html --cover-inclusive
- rsync -av cover/ /var/www/progstats.namibsun.net/data/coverage/xdcc-dl --delete-before
- python3 -m venv virtual && source virtual/bin/activate && python setup.py install
- python-unittest

pypi_dist:
release_upload:
stage: release
only:
- master
tags:
- python3
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install twine wheel
- echo "$PYPIRC" > ~/.pypirc
- python3 setup.py bdist_wheel sdist
- twine upload dist/*
- python3 -m venv virtual && source virtual/bin/activate && python setup.py install
- github-release-upload $(cat version) "$(changelog-reader)"
- gitlab-release-upload $(cat version) "$(changelog-reader)"

upload_release_to_github:
pypi_upload:
stage: release
only:
- master
tags:
- python3
script:
- mkdir -p artifacts
- git clone https://gitlab.namibsun.net/namboy94/ci-scripts.git
- python3 ci-scripts/src/changelog-reader/changelog-reader.py -c CHANGELOG -d current_changelog
- python3 ci-scripts/src/github-release-uploader/github-release-uploader.py namboy94 xdcc-dl $GITHUB_ACCESS_TOKEN
$(python3 setup.py -V) current_changelog artifacts -b master
- python3 -m venv virtual && source virtual/bin/activate && python setup.py install
- pypi-upload

upload_release_to_gitlab:
stage: release
only:
- master
gitstats:
stage: stats
tags:
- python3
- gitstats
script:
- mkdir -p artifacts
- git clone https://gitlab.namibsun.net/namboy94/ci-scripts.git
- python3 ci-scripts/src/changelog-reader/changelog-reader.py -c CHANGELOG -d current_changelog
- python3 ci-scripts/src/gitlab-release-uploader/gitlab-release-uploader.py namboy94 xdcc-dl $GITLAB_ACCESS_TOKEN
$(python3 setup.py -V) current_changelog artifacts -b master -u https://gitlab.namibsun.net
- python3 -m venv virtual && source virtual/bin/activate && python setup.py install
- gitstats-gen

generate_sphinx_documentation:
stage: docs
only:
- master
- develop
docgen:
stage: stats
tags:
- python3
- latex
- progstats-live
script:
- python3 -m venv virtual && source virtual/bin/activate && pip install sphinx sphinx_rtd_theme
- python3 setup.py install
- cd doc
- make buildsource
- make latexpdf
- make html
- rsync -av build/latex/xdcc-dl.pdf /var/www/progstats.namibsun.net/data/doc_pdf/xdcc-dl.pdf --delete-before
- rsync -av build/html/ /var/www/progstats.namibsun.net/data/doc_html/xdcc-dl --delete-before
- python3 -m venv virtual && source virtual/bin/activate && python setup.py install
- sphinx-docgen
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
V 3.0.1:
- Restructured project to make use of theimproved ci-scripts
V 3.0.0:
- Redid the layer structure to be contained in a single, more concise class
- Integrated Progstats URL
Expand Down
26 changes: 2 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing to xdcc-dl
# Contributing

## Copyright and Management

Expand All @@ -8,33 +8,11 @@ of this project and may steer the development process as he sees fit.
Contributions will be attributed to the author of said code and the copyright will
remain the author's.

## Coding guidelines

**Testing**

Due to the nature of this project, testing is rather complicated. Small unit
tests for the offline components should be implemented, however the online
components may prove to be too cumbersome to test. To test those, a complete
server infrastructure would be required.

**Style**

We feel that a unified coding style is important, which is why we require a linter to
be used. In this case **pycodestyle** is used. Code must pass `pycodestyle`'s tests.

**Documentation**

We use sphinx-autodoc to create automated documentation from docstring comments. As a result, all
classes, methods and class/instance variables should be described using docstring comments.

Hard to understand parts of code within a method should always be commented
accordingly.

## Contributing

All active development is done on a [self-hosted Gitlab server](https://gitlab.namibsun.net).
To contribute, send an email to hermann@krumreyh.com to create an account. Once you have an
account, you may issue a merge or pull request.

Using the Gitlab issue tracker is preferred, but the issues on Github are also
taken into consideration.
taken into consideration.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include version
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

|master|develop|
|:---:|:---:|
|[![build status](https://gitlab.namibsun.net/namboy94/xdcc-dl/badges/master/build.svg)](https://gitlab.namibsun.net/namboy94/xdcc-dl/commits/master)|[![build status](https://gitlab.namibsun.net/namboy94/xdcc-dl/badges/develop/build.svg)](https://gitlab.namibsun.net/namboy94/xdcc-dl/commits/develop)|
|[![build status](https://gitlab.namibsun.net/namibsun/python/xdcc-dl/badges/master/build.svg)](https://gitlab.namibsun.net/namibsun/python/xdcc-dl/commits/master)|[![build status](https://gitlab.namibsun.net/namibsun/python/xdcc-dl/badges/develop/build.svg)](https://gitlab.namibsun.net/namibsun/python/xdcc-dl/commits/develop)|

![Logo](resources/logo/logo-readme.png)

Expand Down Expand Up @@ -88,13 +88,13 @@ download_packs(combined)

## Projects using xdcc-dl

* [toktokkie](https://gitlab.namibsun.net/namboy94/toktokkie)
* [toktokkie](https://gitlab.namibsun.net/namibsun/python/toktokkie)

## Further Information

* [Changelog](https://gitlab.namibsun.net/namboy94/xdcc-dl/raw/master/CHANGELOG)
* [License (GPLv3)](https://gitlab.namibsun.net/namboy94/xdcc-dl/raw/master/LICENSE)
* [Gitlab](https://gitlab.namibsun.net/namboy94/xdcc-dl)
* [Changelog](CHANGELOG)
* [License (GPLv3)](LICENSE)
* [Gitlab](https://gitlab.namibsun.net/namibsun/python/xdcc-dl)
* [Github](https://github.com/namboy94/xdcc-dl)
* [Python Package Index Site](https://pypi.python.org/pypi/xdcc_dl)
* [Progstats](https://progstats.namibsun.net/projects/xdcc-dl)
* [PyPi](https://pypi.org/project/xdcc-dl)
2 changes: 1 addition & 1 deletion bin/xdcc-dl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
"""LICENSE
Copyright 2016-2018 Hermann Krumrey
Copyright 2016 Hermann Krumrey
This file is part of xdcc-dl.
Expand Down
2 changes: 1 addition & 1 deletion bin/xdcc-search
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
"""LICENSE
Copyright 2016-2018 Hermann Krumrey
Copyright 2016 Hermann Krumrey
This file is part of xdcc-dl.
Expand Down
Empty file removed doc/__init__.py
Empty file.
86 changes: 0 additions & 86 deletions doc/source/conf.py

This file was deleted.

2 changes: 1 addition & 1 deletion doc/Makefile → doc/sphinx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,6 @@ pseudoxml:


buildsource:
sphinx-apidoc -f ../xdcc_dl -o source
sphinx-apidoc -f ../../xdcc_dl -o source
@echo "Auto-generation of API documentation finished. " \
"The generated files are in 'source/'"
55 changes: 55 additions & 0 deletions doc/sphinx/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env python3
"""LICENSE
Copyright 2016 Hermann Krumrey
This file is part of xdcc-dl.
xdcc-dl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
xdcc-dl is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with xdcc-dl. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""

# noinspection PyPackageRequirements
import sphinx_rtd_theme
# noinspection PyPackageRequirements
from sphinx.ext.autodoc import between

# noinspection PyShadowingBuiltins
copyright = '2016 Hermann Krumrey'
author = 'Hermann Krumrey'
project = 'xdcc-dl'

extensions = ["sphinx.ext.autodoc"]
master_doc = "index"

with open("../../../version", "r") as version_file:
version = version_file.read()
release = version

# HTML Theme Config
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]


def setup(app):
"""
Registers an autodoc between listener to ignore License texts
:param app: The sphinx app
:return: None
"""
app.connect('autodoc-process-docstring',
between('^.*LICENSE.*$', exclude=True))
app.connect("autodoc-skip-member",
lambda a, b, name, d, skipper, f:
False if name == "__init__" else skipper)
return app
7 changes: 1 addition & 6 deletions doc/source/index.rst → doc/sphinx/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
.. xdcc-dl documentation master file, created by
sphinx-quickstart on Sat Apr 9 01:18:26 2016.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to xdcc-dl's documentation!
===================================

Expand All @@ -12,11 +7,11 @@ Contents:
:maxdepth: 2

xdcc_dl.rst
modules.rst

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

Loading

0 comments on commit e7f5ae2

Please sign in to comment.