@@ -4,7 +4,7 @@ layout: docs
44---
55
66This topic describes how to contribute to the Tableau Server Client (Python)
7- project.
7+ project:
88
99<!-- prettier-ignore -->
1010- TOC
@@ -21,11 +21,9 @@ add your contributions to the **development** branch.
2121### Get the source code and set up your branch
2222
23231 . Make sure you have
24- [ signed the CLA] ( https://tableau.github.io/contributing.html )
24+ [ signed the CLA] ( https://tableau.github.io/contributing.html ) .
2525
26- 1 . Fork the repository.
27-
28- We follow the "Fork and Pull" model as described
26+ 1 . Fork the repository. We follow the "Fork and Pull" model as described
2927 [ here] ( https://help.github.com/articles/about-collaborative-development-models/ ) .
3028
31291 . Clone your fork:
@@ -40,16 +38,14 @@ add your contributions to the **development** branch.
4038 python setup.py test
4139 ```
4240
43- 1 . Set up the feature, fix, or documentation branch.
44-
45- It is recommended to use the format issue#-type-description (e.g.
46- 13-fix-connection-bug) like so:
41+ 1 . Set up the feature/fix branch (based off the ` development ` branch). It is
42+ recommended to use the format issue#-type-description, for example:
4743
4844 ``` shell
49- git checkout -b 13-feature-new-stuff development
45+ git checkout -b 13-fix-connection-bug development
5046 ```
5147
52- For documentation changes, see the documentation section below.
48+ For documentation changes, see the documentation section below.
5349
5450### Code and commit
5551
@@ -60,42 +56,58 @@ Here's a quick checklist to follow when coding to ensure a good pull request
6056 goal.
6157- Ensure all indentation is done as 4-spaces and your editor is set to unix line
6258 endings.
63- - The code matches PEP8 style guides. If you cloned the repo you can run
64- ` pycodestyle tableauserverclient test samples `
65- - Keep commit messages clean and descriptive. If the PR is accepted it will get
66- 'Squashed' into a single commit before merging, the commit messages will be
67- used to generate the Merge commit message.
59+ - The code matches PEP8 style guides. Make sure to run
60+ ` pycodestyle tableauserverclient test samples ` to catch and fix any style
61+ issues before submitting your pull request.
62+ - Keep commit messages clean and descriptive.
63+
64+ ### Adding features
65+
66+ 1 . Create an endpoint class for the new feature, following the structure of the
67+ other endpoints. Each endpoint usually has ` get ` , ` post ` , ` update ` , and
68+ ` delete ` operations that require making the url, creating the XML request if
69+ necessary, sending the request, and creating the target item object based on
70+ the server response.
71+
72+ 1 . Create an item class for the new feature, following the structure of the
73+ other item classes. Each item has properties that correspond to what
74+ attributes are sent to/received from the server (refer to docs and Postman
75+ for attributes). Some items also require constants for user input that are
76+ limited to specific strings. After making all the properties, make the
77+ parsing method that takes the server response and creates an instances of the
78+ target item. If the corresponding endpoint class has an update function, then
79+ parsing is broken into multiple parts (refer to another item like workbook or
80+ datasource for example).
81+
82+ 1 . Add testing by getting real xml responses from the server, and asserting that
83+ all properties are parsed and set correctly.
84+
85+ 1 . Add a sample to show users how to use the new feature.
6886
6987### Add tests
7088
7189All of our tests live under the ` test/ ` folder in the repository. We use
72- ` pytest ` and the built-in test runner ` python setup.py test ` . If a test needs a
73- static file, like a .twb/.twbx, it should live under ` test/assets/ `
90+ ` pytest ` and the built-in test runner ` python setup.py test ` .
7491
75- ### Update the documentation
92+ Follow the structure of existing tests, especially if new server responses
93+ are going to be mocked.
7694
77- When adding a new feature or improving existing functionality we may ask that
78- you update the documentation along with your code.
95+ If a test needs a
96+ static file, like a .twb/.twbx/.xml, it should live under ` test/assets/ `
7997
80- Our documentation is written in markdown and built with Jekyll on GitHub Pages.
81- All of the documentation source files can be found in ` /docs ` folder in the
82- ** gh-pages** branch. The docs are hosted on the following URL:
83- [ https://tableau.github.io/server-client-python ] ( https://tableau.github.io/server-client-python )
98+ Make sure that all tests are passing before submitting your pull request.
8499
85- If you are just making documentation updates (adding new docs, fixing typos,
86- improving wording) the easiest method is to use the built-in ` Edit this file `
87- feature right in GitHub (click the pencil icon). If you are viewing one of the
88- pages on
89- [ https://tableau.github.io/server-client-python ] ( https://tableau.github.io/server-client-python ) ,
90- clicking the ** Edit this page** link at the top of the page will take you to the
91- same place.
100+ ### Update the documentation
101+
102+ When adding a new feature or improving existing functionality we ask that you
103+ update the documentation along with your code. See the Updating documentation
104+ section below for details.
92105
93- ### Commit changes to your fork and open a PR
106+ ### Commit changes to your fork and open a pull request
94107
951081 . Make a PR as described
96109 [ here] ( https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork )
97- against the ** development** branch for code changes, or against ** gh-pages**
98- for documentation updates.
110+ against the ** development** branch for code changes.
99111
1001121 . Wait for a review and address any feedback. While we try and stay on top of
101113 all issues and PRs it might take a few days for someone to respond. Politely
@@ -107,33 +119,38 @@ same place.
107119 width="5%"} (:rocket : 's) from members of the core team they will merge the
108120 PR.
109121
110- ---
122+ ## Updating documentation
111123
112- ## Add new features
124+ Our documentation is written in Markdown (specifically
125+ [ kramdown] ( https://kramdown.gettalong.org/quickref.html ) ) and built with Jekyll
126+ on GitHub Pages.
113127
114- 1 . Create an endpoint class for the new feature, following the structure of the
115- other endpoints. Each endpoint usually has ` get ` , ` post ` , ` update ` , and
116- ` delete ` operations that require making the url, creating the XML request if
117- necessary, sending the request, and creating the target item object based on
118- the server response.
128+ All of the documentation source files can be found in ` /docs ` folder in the
129+ ** gh-pages** branch. The docs are hosted on the following URL:
130+ < https://tableau.github.io/server-client-python > .
119131
120- 1 . Create an item class for the new feature, following the structure of the
121- other item classes. Each item has properties that correspond to what
122- attributes are sent to/received from the server (refer to docs and Postman
123- for attributes). Some items also require constants for user input that are
124- limited to specific strings. After making all the properties, make the
125- parsing method that takes the server response and creates an instances of the
126- target item. If the corresponding endpoint class has an update function, then
127- parsing is broken into multiple parts (refer to another item like workbook or
128- datasource for example).
132+ If you are just making documentation updates (adding new docs, fixing typos,
133+ improving wording) the easiest method is to use the built-in ` Edit this file `
134+ feature (the pencil icon) or the ` Edit this page ` link.
129135
130- 1 . Add testing by getting real xml responses from the server, and asserting that
131- all properties are parsed and set correctly.
136+ To make more significant changes or additions, please create a pull request
137+ against the ** gh-pages** branch. When submitted along with a code pull request
138+ (as described above), you can include a link in the PR text so it's clear they
139+ go together.
132140
133- 1 . Add a sample to show users how to use the new feature.
141+ ### Running docs locally
142+
143+ To preview and run the documentation locally, these are the steps:
144+
145+ 1 . Install [ Ruby] ( https://www.ruby-lang.org/en/downloads/ ) (v2.5.0 or higher)
146+
147+ 1 . Install [ Bundler] ( https://bundler.io/ )
148+
149+ 1 . Install [ Jekyll] ( https://jekyllrb.com/docs/installation/ )
150+
151+ 1 . Run the Jekyll site locally with ` bundle exec jekyll serve `
134152
135- <!--
136- ### Updating Documentation
153+ 1 . In your browser, connect to < http://127.0.0.1:4000/server-client-python/ >
137154
138- ### Running Tests
139- -->
155+ For more details on the steps, see the GitHub Pages topic on
156+ [ testing locally ] ( https://docs.github.com/en/github/working-with-github-pages/testing-your-github-pages-site-locally-with-jekyll ) .
0 commit comments