Skip to content

Commit 4957a75

Browse files
committed
feat: template for python packages
0 parents  commit 4957a75

44 files changed

Lines changed: 1983 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3
2+
3+
RUN python -m pip install --upgrade pip \
4+
&& python -m pip install 'flit>=3.8.0'
5+
6+
ENV FLIT_ROOT_INSTALL=1
7+
8+
COPY pyproject.toml .
9+
RUN touch README.md \
10+
&& mkdir -p src/python_package \
11+
&& python -m flit install --only-deps --deps develop \
12+
&& rm -r pyproject.toml README.md src

.devcontainer/devcontainer.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.222.0/containers/python-3-miniconda
3+
{
4+
"name": "Python Environment",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"context": ".."
8+
},
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"editorconfig.editorconfig",
13+
"github.vscode-pull-request-github",
14+
"ms-azuretools.vscode-docker",
15+
"ms-python.python",
16+
"ms-python.vscode-pylance",
17+
"ms-python.pylint",
18+
"ms-python.isort",
19+
"ms-python.flake8",
20+
"ms-python.black-formatter",
21+
"ms-vsliveshare.vsliveshare",
22+
"ryanluker.vscode-coverage-gutters",
23+
"tamasfe.even-better-toml",
24+
"GitHub.copilot"
25+
],
26+
"settings": {
27+
"python.defaultInterpreterPath": "/usr/local/bin/python",
28+
"black-formatter.path": [
29+
"/usr/local/py-utils/bin/black"
30+
],
31+
"pylint.path": [
32+
"/usr/local/py-utils/bin/pylint"
33+
],
34+
"flake8.path": [
35+
"/usr/local/py-utils/bin/flake8"
36+
],
37+
"isort.path": [
38+
"/usr/local/py-utils/bin/isort"
39+
]
40+
}
41+
}
42+
},
43+
"onCreateCommand": "pre-commit install"
44+
}

.github/.templatesyncignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.github/workflows/sched-template-sync.yml
2+
.github/.templatesyncingnore
3+
src/python_package
4+
tests/test_methods.py

.github/CODE_OF_CONDUCT.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official email address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
[INSERT CONTACT METHOD].
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series of
86+
actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or permanent
93+
ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within the
113+
community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.1, available at
119+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120+
121+
Community Impact Guidelines were inspired by
122+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123+
124+
For answers to common questions about this code of conduct, see the FAQ at
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126+
[https://www.contributor-covenant.org/translations][translations].
127+
128+
[homepage]: https://www.contributor-covenant.org
129+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130+
[Mozilla CoC]: https://github.com/mozilla/diversity
131+
[FAQ]: https://www.contributor-covenant.org/faq
132+
[translations]: https://www.contributor-covenant.org/translations

.github/CONTRIBUTING.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Contributing
2+
3+
Want to help? Thanks so much, there's something to do for everybody!
4+
5+
Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
6+
7+
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
8+
9+
## Using the issue tracker
10+
11+
The [issue tracker](https://github.com/altcoder/template-python/issues) is
12+
the preferred channel for [bug reports](#bugs), [features requests](#features)
13+
and [submitting pull requests](#pull-requests).
14+
15+
<a name="bugs"></a>
16+
## Bug reports
17+
18+
A bug is a _demonstrable problem_ that is caused by the code in the repository.
19+
Good bug reports are extremely helpful - thank you!
20+
21+
Guidelines for bug reports:
22+
23+
1. **Use the GitHub issue search** &mdash; check if the issue has already been reported.
24+
25+
2. **Check if the issue has been fixed** &mdash; try to reproduce it using the latest `main` branch in the repository.
26+
27+
3. **Isolate the problem** &mdash; ideally create a reduced test case.
28+
29+
A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and OS
30+
experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs.
31+
32+
Example:
33+
34+
> Short and descriptive example bug report title
35+
>
36+
> A summary of the issue and the browser/OS environment in which it occurs. If
37+
> suitable, include the steps required to reproduce the bug.
38+
>
39+
> 1. This is the first step
40+
> 2. This is the second step
41+
> 3. Further steps, etc.
42+
>
43+
> `<url>` - a link to the reduced test case
44+
>
45+
> Any other information you want to share that is relevant to the issue being
46+
> reported. This might include the lines of code that you have identified as
47+
> causing the bug, and potential solutions (and your opinions on their
48+
> merits).
49+
50+
51+
<a name="features"></a>
52+
## Feature requests
53+
54+
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
55+
56+
57+
<a name="pull-requests"></a>
58+
## Pull requests
59+
60+
Good pull requests - patches, improvements, new features - are a fantastic
61+
help. They should remain focused in scope and avoid containing unrelated
62+
commits.
63+
64+
**Please ask first** before embarking on any significant pull request (e.g.
65+
implementing features, refactoring code, porting to a different language),
66+
otherwise you risk spending a lot of time working on something that the
67+
project's developers might not want to merge into the project.
68+
69+
Please adhere to the coding conventions used throughout a project (indentation,
70+
accurate comments, etc.) and any other requirements (such as test coverage).
71+
72+
Adhering to the following process is the best way to get your work
73+
included in the project:
74+
75+
1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork, and configure the remotes:
76+
77+
```bash
78+
# Clone your fork of the repo into the current directory
79+
git clone https://github.com/<your-username>/template-python.git
80+
# Navigate to the newly cloned directory
81+
cd template-python
82+
# Assign the original repo to a remote called "upstream"
83+
git remote add upstream https://github.com/altcoder/template-python.git
84+
```
85+
86+
2. If you cloned a while ago, get the latest changes from upstream:
87+
88+
```bash
89+
git checkout main
90+
git pull upstream main
91+
```
92+
93+
3. Create a new topic branch (off the `main` branch) to contain your feature, change, or fix:
94+
95+
```bash
96+
git checkout -b <topic-branch-name>
97+
```
98+
99+
4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) and [git commit conventions](https://www.conventionalcommits.org/en/v1.0.0/) or your code is unlikely be merged into the main project. Use Git's [interactive rebase](https://help.github.com/articles/about-git-rebase/) feature to tidy up your commits before making them public.
100+
101+
5. Locally merge (or rebase) the upstream main branch into your topic branch:
102+
103+
```bash
104+
git pull [--rebase] upstream main
105+
```
106+
107+
6. Push your topic branch up to your fork:
108+
109+
```bash
110+
git push origin <topic-branch-name>
111+
```
112+
113+
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
114+
with a clear title and description.
115+
116+
**IMPORTANT**: By submitting a patch, you agree to allow the project
117+
owners to license your work under the terms of the [MIT License](https://github.com/altcoder/template-python/blob/main/LICENSE.md).

.github/ISSUE_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# philippines-psgc-shapefiles
2+
3+
Before opening a new issue, please take a moment to review our [**community guidelines**](https://github.com/altcoder/template-python/blob/main/.github/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved.
4+
5+
**Before opening a new issue, you may find an answer in already closed issues**:
6+
https://github.com/altcoder/template-python/issues?q=is%3Aissue+is%3Aclosed
7+
8+
## Issue Type
9+
10+
- [ ] [Bug](https://github.com/altcoder/template-python/blob/master/.github/CONTRIBUTING.md#bug-reports)
11+
- [ ] [Feature](https://github.com/altcoder/template-python/blob/master/.github/CONTRIBUTING.md#feature-requests)
12+
13+
## Description
14+
15+
(Add images if possible)
16+
17+
## Steps to reproduce
18+
19+
(Add test or demo if possible)
20+
21+
# Versions
22+
23+
(Add language, libraries and project version if possible)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
---
5+
6+
Before opening a new issue, please take a moment to review our [**community guidelines**](https://github.com/altcoder/template-python/blob/main/.github/CONTRIBUTING.md) to make the contribution process easy and effective for everyone involved.
7+
8+
## Description
9+
A clear and concise description of what the bug is.
10+
11+
## Steps to reproduce
12+
Steps to reproduce the behavior.
13+
14+
**Expected behavior**
15+
A clear and concise description of what you expected to happen.
16+
17+
**Screenshots**
18+
If applicable, add screenshots to help explain your problem.
19+
20+
## Versions
21+
22+
- Python:
23+
- Spark:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
---
5+
6+
**Is your feature request related to a problem? Please describe.**
7+
A clear and concise description of what the problem is.
8+
9+
**Describe the solution you'd like**
10+
A clear and concise description of what you want to happen.
11+
12+
**Describe alternatives you've considered**
13+
A clear and concise description of any alternative solutions or features you've considered.
14+
15+
**Additional context**
16+
Add any other context or screenshots about the feature request here.

0 commit comments

Comments
 (0)