Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into CDpypi
Browse files Browse the repository at this point in the history
  • Loading branch information
rkaminsk committed Feb 20, 2024
2 parents 2eaac77 + d2b6042 commit c2881be
Show file tree
Hide file tree
Showing 17 changed files with 226 additions and 125 deletions.
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
- name: "checkout repository"
uses: actions/checkout@v3

- name: "setup python 3.7"
- name: "setup python 3.9"
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.9

- name: "setup python 3.11"
uses: actions/setup-python@v4
Expand Down
2 changes: 0 additions & 2 deletions .isort.cfg

This file was deleted.

1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ repos:
rev: 5.11.5
hooks:
- id: isort
args: ["--profile", "black"]
exclude: ^.github/

- repo: https://github.com/psf/black
Expand Down
31 changes: 0 additions & 31 deletions .pylintrc

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changes

## v1.0.0

- create project
102 changes: 102 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Contributing to fillname

First off, thanks for taking the time to contribute! ❤️

All types of contributions are encouraged and valued. See the [Table of Contents](#table-of-contents) for different ways to help and details about how this project handles them. Please make sure to read the relevant section before making your contribution. It will make it a lot easier for us maintainers and smooth out the experience for all involved. The community looks forward to your contributions. 🎉

> And if you like the project, but just don't have time to contribute, that's fine. There are other easy ways to support the project and show your appreciation, which we would also be very happy about:
> - Star the project
> - Tweet about it
> - Refer this project in your project's readme
> - Mention the project at local meetups and tell your friends/colleagues (please don't bore your friends)
<!-- omit in toc -->
## Table of Contents

- [Asking Question](#asking-questions)
- [Contributing](#contributing)
- [Contributing Code](#contributing-code)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)


## Asking Questions

> If you want to ask a question, we assume that you have read the available [Documentation](https://potassco.org/fillname/).
Before you ask a question, it is best to search for existing [issues](https://github.com/potassco/fillname/issues) or [messages](https://sourceforge.net/p/potassco/mailman/potassco-users/) in the archive of our mailing list.

If you then still feel the need to ask a question and need clarification, we recommend the following:

- [Subscribe](https://sourceforge.net/projects/potassco/lists/potassco-users) to our mailing list on SourceForge or open an [issue](https://github.com/potassco/fillname/issues/new) on GitHub.
- Provide as much context as you can about what you're running into.
- We can best help you if you provide executable code showcasing your problem.

We will then take care of the issue as soon as possible.

## Contributing

> ### Legal Notice <!-- omit in toc -->
> When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
### Contributing Code

To contribute to fillname, please fork the repository and **open a pull request to the main branch**.
Please use the coding style enforced by the precommit hook. To avoid unnecessary work, you can reach out to us to discuss your contribution via one of the ways described below.

### Reporting Bugs

<!-- omit in toc -->
#### Before Submitting a Bug Report

A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.

- Make sure that you are using the latest version.
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions. If you are looking for support, you might want to check [this section](#i-have-a-question)).
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/potassco/fillname/issues?q=label%3Abug).
- Collect information about the bug
- Python Version
- Possibly your input and the output
- Can you reliably reproduce the issue?
- Stack trace (Traceback)

<!-- omit in toc -->
#### How Do I Submit a Good Bug Report?

We use GitHub issues to track bugs and errors. If you run into an issue with the project:

- Open an [Issue](https://github.com/potassco/fillname/issues/new).
- Explain the behavior you would expect and the actual behavior.
- Please provide as much context as possible and describe the *reproduction steps* that someone else can follow to recreate the issue on their own. This usually includes your code. For good bug reports you should isolate the problem and create a reduced test case.
- Provide the information you collected in the previous section.

Once it's filed:

- The project team will label the issue accordingly.
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps.
- If the team is able to reproduce the issue, the issue will be left to be [implemented by someone](#your-first-code-contribution).

### Suggesting Enhancements

This section guides you through submitting an enhancement suggestion for fillname, **including completely new features and minor improvements to existing functionality**. Following these guidelines will help maintainers and the community to understand your suggestion and find related suggestions.

<!-- omit in toc -->
#### Before Submitting an Enhancement

- Make sure that you are using the latest version.
- Read the [documentation](https://potassco.org/fillname/) carefully and find out if the functionality is already covered, maybe by an individual configuration.
- Perform a [search](https://github.com/potassco/fillname/issues) to see if the enhancement has already been suggested. If it has, add a comment to an existing issue instead of opening a new one.
- 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. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.

<!-- omit in toc -->
#### How Do I Submit a Good Enhancement Suggestion?

Enhancement suggestions are tracked as [GitHub issues](https://github.com/potassco/fillname/issues).

- Use a **clear and descriptive title** for the issue to identify the suggestion.
- Provide a **step-by-step description of the suggested enhancement** in as many details as possible.
- **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you.
- **Explain why this enhancement would be useful** and how it improves fillname.

## Attribution
This guide is based on the **contributing-gen**. [Make your own](https://github.com/bttger/contributing-gen)!
45 changes: 44 additions & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,42 @@
To be able to release this project on [test.]pypi.org please follow these instructions:
## Development

To improve code quality, we use [nox] to run linters, type checkers, unit
tests, documentation and more. We recommend installing nox using [pipx] to have
it available globally.

```bash
# install
python -m pip install pipx
python -m pipx install nox

# run all sessions
nox

# list all sessions
nox -l

# run individual session
nox -s session_name

# run individual session (reuse install)
nox -Rs session_name
```

Note that the nox sessions create [editable] installs. In case there are issues,
try recreating environments by dropping the `-R` option. If your project is
incompatible with editable installs, adjust the `noxfile.py` to disable them.

We also provide a [pre-commit][pre] config to autoformat code upon commits. It
can be set up using the following commands:

```bash
python -m pipx install pre-commit
pre-commit install
```

## Deployment

To release this project on (test.)pypi.org please follow these instructions:

Long version:
https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
Expand All @@ -11,3 +49,8 @@ TL;DR
- add the formerly created github environment
- run the respective CI scripts either manually (test.pypi.org) or by tagging a release version (pypi.org)

[nox]: https://nox.thea.codes/en/stable/index.html
[pipx]: https://pypa.github.io/pipx/
[pre]: https://pre-commit.com/
[editable]: https://setuptools.pypa.io/en/latest/userguide/development_mode.html

47 changes: 6 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,18 @@
## Installation

```bash
pip install .
```

## Usage
To install the project, run

```bash
fillname -h
pip install .
```

## Development

To improve code quality, we use [nox] to run linters, type checkers, unit
tests, documentation and more. We recommend installing nox using [pipx] to have
it available globally.

```bash
# install
python -m pip install pipx
python -m pipx install nox

# run all sessions
nox

# list all sessions
nox -l
Further details, please refer to the [development instructions](DEVELOPMENT.md).

# run individual session
nox -s session_name

# run individual session (reuse install)
nox -Rs session_name
```

Note that the nox sessions create [editable] installs. In case there are issues,
try recreating environments by dropping the `-R` option. If your project is
incompatible with editable installs, adjust the `noxfile.py` to disable them.
## Usage

We also provide a [pre-commit][pre] config to autoformat code upon commits. It
can be set up using the following commands:
Run the following for basic usage information:

```bash
python -m pipx install pre-commit
pre-commit install
fillname -h
```

[nox]: https://nox.thea.codes/en/stable/index.html
[pipx]: https://pypa.github.io/pipx/
[pre]: https://pre-commit.com/
[editable]: https://setuptools.pypa.io/en/latest/userguide/development_mode.html
10 changes: 6 additions & 4 deletions init.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ def replace(filepath):

dirs = [os.path.join("src", "fillname"), "tests", "doc"]
files = [
"setup.cfg",
".pre-commit-config.yaml",
"noxfile.py",
"README.md",
"pyproject.toml",
"setup.cfg",
"CONTRIBUTING.md",
"DEVELOPMENT.md",
"LICENSE",
".pre-commit-config.yaml",
".coveragerc",
"README.md",
]

for rootpath in dirs:
Expand Down
15 changes: 3 additions & 12 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import nox

nox.options.sessions = "lint_flake8", "lint_pylint", "typecheck", "test"
nox.options.sessions = "lint_pylint", "typecheck", "test"

EDITABLE_TESTS = True
PYTHON_VERSIONS = None
if "GITHUB_ACTIONS" in os.environ:
PYTHON_VERSIONS = ["3.7", "3.11"]
PYTHON_VERSIONS = ["3.9", "3.11"]
EDITABLE_TESTS = False


Expand Down Expand Up @@ -90,15 +90,6 @@ def dev(session):
session.install("-e", ".[dev]")


@nox.session
def lint_flake8(session):
"""
Run flake8 linter.
"""
session.install("-e", ".[lint_flake8]")
session.run("flake8", "src", "tests")


@nox.session
def lint_pylint(session):
"""
Expand All @@ -114,7 +105,7 @@ def typecheck(session):
Typecheck the code using mypy.
"""
session.install("-e", ".[typecheck]")
session.run("mypy", "-p", "fillname", "-p", "tests")
session.run("mypy", "--strict", "-p", "fillname", "-p", "tests")


@nox.session(python=PYTHON_VERSIONS)
Expand Down
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,43 @@ requires = [
"setuptools-scm",
]
build-backend = "setuptools.build_meta"

[tool.isort]
profile = "black"
line_length = 120

[tool.black]
line-length = 120

[tool.pylint.format]
max-line-length = 120

[tool.pylint.design]
max-args = 10
max-attributes = 7
max-bool-expr = 5
max-branches = 12
max-locals = 30
max-parents = 7
max-public-methods = 20
max-returns = 10
max-statements = 50
min-public-methods = 1

[tool.pylint.similarities]
ignore-comments = true
ignore-docstrings = true
ignore-imports = true
ignore-signatures = true

[tool.pylint.basic]
argument-rgx = "^[a-z][a-z0-9]*((_[a-z0-9]+)*_?)?$"
variable-rgx = "^[a-z][a-z0-9]*((_[a-z0-9]+)*_?)?$"
good-names = ["_"]

[tool.coverage.run]
source = ["fillname", "tests"]
omit = ["*/fillname/__main__.py"]

[tool.coverage.report]
exclude_lines = ["assert", "nocoverage"]
Loading

0 comments on commit c2881be

Please sign in to comment.