File: contribution.rst

package info (click to toggle)
py7zr 0.11.3%2Bdfsg-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,740 kB
  • sloc: python: 6,786; makefile: 198; ansic: 35
file content (175 lines) | stat: -rw-r--r-- 4,600 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
.. _contributor_guide:

:tocdepth: 2

*****************
Contributor guide
*****************

Development environment
=======================

If you’re reading this, you’re probably interested in contributing to py7zr.
Thank you very much! The purpose of this guide is to get you to the point
where you can make improvements to the py7zr and share them with the rest of the team.

Setup Python
------------

The py7zr is written in the Python programming language. Python installation for
various platforms with various ways. You need to install Python environment which
support `pip` command. Venv/Virtualenv is recommended for development.

We have a test suite with python 3.6, 3.7, 3.8 and pypy3.
If you want to run all the test with these versions and variant on your local,
you should install these versions. You can run test with CI environment on
Github actions.


Get Early Feedback
------------------

If you are contributing, do not feel the need to sit on your contribution
until it is perfectly polished and complete. It helps everyone involved
for you to seek feedback as early as you possibly can.
Submitting an early, unfinished version of your contribution
for feedback in no way prejudices your chances of getting that contribution accepted,
and can save you from putting a lot of work into a contribution that is not suitable for the project.


Code Contributions
==================

Steps submitting code
---------------------

When contributing code, you’ll want to follow this checklist:

1. Fork the repository on GitHub.

2. Run the tox tests to confirm they all pass on your system. If they don’t, you’ll need
   to investigate why they fail. If you’re unable to diagnose this yourself,
   raise it as a bug report.

3. Write tests that demonstrate your bug or feature. Ensure that they fail.

4. Make your change.

5. Run the entire test suite again using tox, confirming that all tests pass
   including the ones you just added.

6. Send a GitHub Pull Request to the main repository’s master branch.
   GitHub Pull Requests are the expected method of code collaboration on this project.

Code review
-----------

Contribution will not be merged until they have been code reviewed. There are limited
reviewer in the team, reviews from other contributors are also welcome.
You should implemented a review feedback unless you strongly object to it.


Code style
----------

The py7zr uses the PEP8 code style. In addition to the standard PEP8, we have an extended
guidelines

* line length should not exceed 125 charactors.

* It also use MyPy static type check enforcement.



Class and module design
=======================

The py7zr take class design that categorized into several sub modules
to reflect its role.

The main class is py7zr.SevenZipFile() class which provide API
for library users. The main internal classes are in the submodule
py7zr.archiveinfo, which takes class structure as same as .7z file
format structure.

Another important submodule is py7zr.compressor module that hold
all related compression and encryption proxy classes for corresponding
libraries to convert various interfaces into common ISevenZipCompressor()
and ISevenZipDecompressor() interface.

All UI related classes and functions are separated from core modules.
cli submodule is a place for command line functions and pretty printings.


.. graphviz:: diagrams/packages.dot

Here is a whole classes diagram. There are part by part descriptions at Next sections.

.. graphviz:: diagrams/classes.dot


Header classes
--------------

Header related classes are in py7zr.archiveinfo submodule.

.. graphviz:: diagrams/header_classes.dot


Compressor classes
------------------

There are compression related classes in py7zr.compressor submodule.

.. graphviz:: diagrams/compressor_classes.dot


IO Abstraction classes
----------------------

There are two IO abstraction classes to provide Mem API and check method.

.. graphviz:: diagrams/abstractio.dot


Callback classes
----------------

Here is a callback interface class. ExtractCallback class is a concrete class used in CLI.

.. graphviz:: diagrams/callbacks.dot


.. _internal_classes:

Classes details
================

Here is a detailed interface documentation for implementer.

ArchiveFile Objects
-------------------

.. automodule:: py7zr.py7zr
   :members:


archiveinfo module
------------------

.. automodule:: py7zr.archiveinfo
   :members:


compressor module
------------------

.. automodule:: py7zr.compressor
   :members:


helpers module
--------------

.. automodule:: py7zr.helpers
   :members: