Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyOTRS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Som Connexió
OTRS
PyOTRS
Commits
f236a09c
Commit
f236a09c
authored
8 years ago
by
Robert Habermann
Browse files
Options
Downloads
Patches
Plain Diff
remove README.rst and pre-commit as this can be done more nicely
parent
7430f21d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.rst
+0
-134
0 additions, 134 deletions
README.rst
pre-commit.sh
+0
-2
0 additions, 2 deletions
pre-commit.sh
setup.cfg
+3
-0
3 additions, 0 deletions
setup.cfg
with
3 additions
and
136 deletions
README.rst
deleted
100644 → 0
+
0
−
134
View file @
7430f21d
Template
========
Getting Started
---------------
Get and initialize template
~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
git clone https://github.com/frennkie/template
mv template NEW_PROJECT_NAME
cd NEW_PROJECT_NAME
Customize
~~~~~~~~~
Weired stuff.. don't name your python files the same as the
NEW\_PROJECT\_NAME.
There will be import trouble (at least when testing!)
Run script to change "template" to something that fits your project (not
yet implemented!!)
::
./bin/start_project_from_template.sh NEW_PROJECT_NAME
::
virtualenv NEW_PROJECT_NAME/venv
source NEW_PROJECT_NAME/venv/bin/activate
pip install pip --upgrade
pip install -r requirements.txt
Verify all is good
::
py.test
Code
----
Magic Happens Here (don't forget Testing, Versioning/Commiting and so
on)
Important non-coding stuff (Testing, Versioning/Git-Flow, Packaging, PEP8)
--------------------------------------------------------------------------
Run Tests
~~~~~~~~~
::
py.test -v
Result should be similar to this:
::
$: py.test
================================================================================
test session starts
================================================================================
platform linux2 -- Python 2.7.8 -- py-1.4.30 -- pytest-2.7.2
rootdir: /home/XXX/template, inifile: setup.cfg
plugins: cache
collected 2 items
template/tests/test_misc.py .
template/tests/test_something.py .
================================================================================
2 passed in 0.05 seconds
================================================================================
Versioning/Git-Flow
~~~~~~~~~~~~~~~~~~~
Versioning Style: - Mayor Version: e.g. 0 \| 1 \| 2 - Minor Version: odd
numbers for dev releases; even for stable releases - Last Part: String
or Number - for Hotfixes and Dev stages (e.g. 0 \| 1 \| dev1)
Example: - ``0.3.dev2`` - unstable release; 2nd dev iteration -
``0.4.0`` - stable release 0.4 - ``0.6.2`` - stable release 0.6 after 2
Hotfixes
This Style is supported by Git-Flow
http://danielkummer.github.io/git-flow-cheatsheet/
Reminders - avoid the hotfixes.. just stick with feature branches - if
you need to create a hotfix starting from an old master/release state
create tags manually - the following is extremely useful for bumping
version numbers in multiple files
::
sed -i "s/__version_info__ = ('0', '2', '0')/__version_info__ = ('0', '2', '1')/gi" *.py modules/*.py tests/*.py
Packaging
~~~~~~~~~
::
python setup.py sdist
Test coverage
~~~~~~~~~~~~~
``pip install pytest-cov``
.coveragerc:
::
[run]
omit = venv/*, tests/*
::
cd template
py.test --cov .
PEP8 (getting really funky now.. ;-) )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
# E402 can not be passed in tests because we need to add parent dir to path
pep8 --exclude=venv --ignore=E402 .
This diff is collapsed.
Click to expand it.
pre-commit.sh
deleted
100755 → 0
+
0
−
2
View file @
7430f21d
[
-f
/usr/bin/pandoc
]
&&
/usr/bin/pandoc
-o
README.rst README.md
exit
0
This diff is collapsed.
Click to expand it.
setup.cfg
+
3
−
0
View file @
f236a09c
...
...
@@ -2,3 +2,6 @@
[pytest]
norecursedirs
=
.git
addopts
=
--doctest-modules
[metadata]
description-file
=
README.md # This tells PyPI where your README file is.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment