Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit edc4ca4

Browse files
committed
Initial commit
0 parents  commit edc4ca4

36 files changed

+1485
-0
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
*.egg-info
2+
dist/
3+
build/
4+
docs/build
5+
docs/source/.doctrees/
6+
__pycache__/
7+
.cache
8+
*.sqlite3
9+
.tox/
10+
*.swp
11+
*.pyc
12+
.coverage*
13+
.pytest_cache
14+
node_modules
15+
venv/
16+
17+
# IDE and Tooling files
18+
.idea/*
19+
*~
20+
21+
# macOS
22+
.DS_Store

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: python
2+
cache: pip
3+
sudo: required
4+
matrix:
5+
fast_finish: true
6+
include:
7+
- { python: "3.6", env: DJANGO=2.0 }
8+
- { python: "3.6", env: DJANGO=2.1 }
9+
- { python: "3.7", env: DJANGO=2.0 }
10+
- { python: "3.7", env: DJANGO=2.1 }
11+
- { python: "3.7", env: TOXENV=lint }
12+
- { python: "3.7", env: TOXENV=docs }
13+
allow_failures:
14+
- env: TOXENV=docs
15+
services:
16+
- docker
17+
install:
18+
- pip install '.[dev]' tox-travis
19+
before_script:
20+
- docker-compose -f dev/docker-compose.yml up -d
21+
script:
22+
- tox
23+
after_success:
24+
- pip install codecov
25+
- codecov -e TOXENV,DJANGO
26+
notifications:
27+
email: false

CONTRIBUTING.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Contributing Guidelines
2+
=======================
3+
4+
Issue tracker
5+
-------------
6+
您可以通过 `issue tracker <https://github.com/chaitin/django-pg-timepart/issue>`_ 提交改进建议、缺陷报告或功能需求,但 **必须** 遵守以下规范:
7+
8+
* **请勿** 重复提交相似的主题或内容。
9+
* **请勿** 讨论任何与本项目无关的内容。
10+
* 我们非常欢迎您提交程序缺陷报告,但在此之前,请确保您已经完整阅读过相关文档,并已经做了一些必要的调查,确定错误并非您自身造成的。在您编写程序缺陷报告时,
11+
请详细描述您所出现的问题和复现步骤,并附带详细的信息,以便我们能尽快定位问题。
12+
13+
----
14+
15+
You can submit improvement suggestions, bug reports, or feature requests through the `issue tracker <https://github.com/chaitin/django-pg-timepart/issue>`_,
16+
but you **MUST** adhere to the following specifications:
17+
18+
* **Do not** submit similar topics or content repeatedly.
19+
* **Do not** discuss any content not related to this project.
20+
* We welcome you to submit a bug report, but before doing so, please make sure that you have read the documentation in its entirety and
21+
have done some necessary investigations to determine that the error is not yours. When you write a bug report, Please describe in detail
22+
the problem and recurring steps that you have with detailed information so that we can locate the problem as quickly as possible.
23+
24+
Code guidelines
25+
---------------
26+
* 本项目采用 `语义化版本 2.0.0 <https://semver.org/spec/v2.0.0.html>`_
27+
* 本项目使用了 `flask8` `isort` `black` 等代码静态检查工具。提交的代码 **必须** 通过 `lint` 工具检查。某些特殊情况不符合规范的部分,需要按照检查工具要求的方式具体标记出来。
28+
* 公开的 API **必须** 使用 Type Hint 并编写 Docstrings,其他部分 **建议** 使用并在必要的地方为代码编写注释,增强代码的可读性。
29+
* **必须** 限定非 Development 的外部依赖的模块版本为某一个完全兼容的系列。
30+
31+
相关文档:
32+
33+
| `Google Python Style Guide <https://github.com/google/styleguide/blob/gh-pages/pyguide.md>`_
34+
| `PEP 8 Style Guide for Python Code <https://www.python.org/dev/peps/pep-0008/>`_
35+
36+
----
37+
38+
* This project uses a `Semantic Version 2.0.0 <https://semver.org/spec/v2.0.0.html>`_
39+
* This project uses a code static check tool such as `flask8` `isort` `black`. The submitted code **MUST** be checked by the `lint` tool.
40+
Some special cases that do not meet the specifications need to be specifically marked in the way required by the inspection tool.
41+
* The public API **MUST** use Type Hint and write Docstrings, other parts **SHOULD** use it and write comments to the code where necessary
42+
to enhance the readability of code.
43+
* External dependencies published with the project **MUST** at least define a fully compatible version family.
44+
45+
Related documents:
46+
47+
| `Google Python Style Guide <https://github.com/google/styleguide/blob/gh-pages/pyguide.md>`_
48+
| `PEP 8 Style Guide for Python Code <https://www.python.org/dev/peps/pep-0008/>`_

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2019 Chaitin Tech Co., Ltd.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
15+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
17+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
18+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
19+
OR OTHER DEALINGS IN THE SOFTWARE.

README.rst

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
django-pg-timepart
2+
==================
3+
.. image:: https://img.shields.io/badge/License-MIT-orange.svg?style=flat-square
4+
:target: https://raw.githubusercontent.com/chaitin/django-partitioning/master/LICENSE
5+
.. image:: https://img.shields.io/badge/Django-2.0_2.1-green.svg?style=flat-square&logo=django
6+
:target: https://www.djangoproject.com/
7+
.. image:: https://img.shields.io/badge/PostgreSQL-11-lightgrey.svg?style=flat-square&logo=postgresql
8+
:target: https://www.postgresql.org/
9+
10+
一个实现 PostgreSQL 表基于日期进行分区和管理的 Django 扩展。
11+
它适用于像记录日志、消息或文章等具有时间列的巨型表进行分区管理,定期创建新的分区并归档旧的分区。
12+
13+
----
14+
15+
A Django extension that implements PostgreSQL tables for partitioning and management based on dates.
16+
It is suitable for partition management of giant tables with time columns like logging, messages or articles,
17+
periodically creating new partitions and archiving old partitions.
18+
19+
Documentation
20+
https://django-pg-timepart.readthedocs.io/en/latest/
21+
22+
Contributing
23+
------------
24+
25+
如果您有意为本开源项目出一份力,我们十分欢迎!在此之前,请首先阅读我们的 `Contributing Guidelines <https://raw.githubusercontent.com/chaitin/django-partitioning/master/CONTRIBUTING>`__。
26+
27+
----
28+
29+
If you want to contribute to a project and make it better, you help is very welcome!
30+
Please read through `Contributing Guidelines <https://raw.githubusercontent.com/chaitin/django-pg-timepart/master/CONTRIBUTING>`__.
31+
32+
License
33+
-------
34+
35+
django-pg-timepart 使用 MIT 开源协议。协议文本请阅读 LICENSE。
36+
37+
----
38+
39+
django-pg-timepart is licensed under the MIT. Please see `LICENSE <https://raw.githubusercontent.com/chaitin/django-pg-timepart/master/LICENSE>`_.

codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
coverage:
2+
precision: 2
3+
round: down
4+
range: "80...100"
5+
6+
status:
7+
project: yes
8+
patch: no
9+
changes: no
10+
11+
comment: off

dev/docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: "3"
2+
services:
3+
postgres:
4+
image: postgres:11.1-alpine
5+
container_name: postgres
6+
restart: always
7+
volumes:
8+
- ./postgres_init.sh:/docker-entrypoint-initdb.d/postgres_init.sh
9+
environment:
10+
- POSTGRES_DB=test
11+
- POSTGRES_USER=test
12+
- POSTGRES_PASSWORD=test
13+
ports:
14+
- "127.0.0.1:5432:5432"

dev/postgres_init.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
mkdir /tmp/data1 /tmp/data2
4+
psql -U test -c "CREATE TABLESPACE data1 LOCATION '/tmp/data1'"
5+
psql -U test -c "CREATE TABLESPACE data2 LOCATION '/tmp/data2'"

docs/Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Minimal makefile for Sphinx documentation
2+
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = django-partitioning
8+
SOURCEDIR = source
9+
BUILDDIR = _build
10+
11+
12+
.PHONY: all
13+
all:
14+
@$(SPHINXBUILD) "$(SOURCEDIR)" "$(BUILDDIR)/"
15+
16+
17+
.PHONY: help
18+
help:
19+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20+
21+
22+
.PHONY: Makefile
23+
# Catch-all target: route all unknown targets to Sphinx using the new
24+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
25+
%: Makefile
26+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/source/_static/logo.png

15.8 KB
Loading

0 commit comments

Comments
 (0)