Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include and improve installation and publication of the package #69

Merged
merged 7 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/issue_template_feature.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Feature Issue
about: For new ideas, developments and features
title: Your title should make sense if said after "The issue is <your issue title>"
labels: ["status: active :construction:", "type: feature :hammer_and_wrench:"]
assignees: ""
assignees: ''
---

## Description of the issue
Expand Down
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Describe the findings of the discussion in the issue or meeting.
## Workflow checklist

### Automation

Part of # / Closes #

### PR-Assignee

- [ ] 🐙 Follow the workflow in [CONTRIBUTING.md](https://github.com/rl-institut/super-repo/blob/production/CONTRIBUTING.md)
- [ ] 📝 Update the [CHANGELOG.md](https://github.com/rl-institut/super-repo/blob/develop/CHANGELOG.md)
- [ ] 📙 Update the documentation
- [ ] 🐙 Assign a reviewer to the PR

### Reviewer

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: codecov

on:
push:
branches: [ production, develop, feature-61-codecov ]
branches: [ production, develop ]

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reuse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v4
- name: REUSE compliance check
uses: fsfe/reuse-action@v4
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add documentation for code style [(#63)](https://github.com/rl-institut/super-repo/pull/63)
- Update REUSE [(#66)](https://github.com/rl-institut/super-repo/pull/66)
- Add workflow with codecov [(#68)](https://github.com/rl-institut/super-repo/pull/68)
- Add badges for publication section [(#69)](https://github.com/rl-institut/super-repo/pull/69)

### Changed

- Update CSS to improve toc [(#54)](https://github.com/rl-institut/super-repo/pull/54)
- Update documentation for mike [(#54)](https://github.com/rl-institut/super-repo/pull/54)
- Update GitHub Action for develop branch [(#58)](https://github.com/rl-institut/super-repo/pull/58)
- Update the sections and merge subpages of the documentation [(#62)](https://github.com/rl-institut/super-repo/pull/62)
- Update documentation for release [(#69)](https://github.com/rl-institut/super-repo/pull/69)

### Removed

Expand Down
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: Ludwig Hülk <@Ludee> © Reiner Lemoine Institut
# SPDX-License-Identifier: MIT

exclude .gitignore
exclude .pre-commit-config.yaml
exclude tox.ini

prune .github
prune tests
52 changes: 41 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ super-repo
* - License
- |badge_license| |badge_reuse|
* - Documentation
- |badge_documentation| |badge_codecov|
- |badge_documentation| |badge_tests| |badge_codecov|
* - Publication
-
- |badge_pypi| |badge_python| |badge_pypi_downloads|
* - Development
- |badge_issue_open| |badge_issue_closes| |badge_pr_open| |badge_pr_closes|
* - Community
Expand All @@ -41,21 +41,28 @@ Introduction

Documentation
=============
| The documentation is created with Markdown using `MkDocs <https://www.mkdocs.org/>`_.
| The documentation is created with Markdown using `MkDocs <https://www.mkdocs.org/>`_ and `mike <https://github.com/jimporter/mike>`_.
| All files are stored in the ``docs`` folder of the repository.
| A **GitHub Actions** deploys the ``production`` branch on a **GitHub Page**.
| The documentation page is `rl-institut.github.io/super-repo/ <https://rl-institut.github.io/super-repo/>`_
| A **GitHub Actions** deploys the ``develop`` branch on a **GitHub Page**.
| The documentation page is: `rl-institut.github.io/super-repo/ <https://rl-institut.github.io/super-repo/>`_

Collaboration
=============
| Everyone is invited to develop this repository with good intentions.
| Please follow the workflow described in the `CONTRIBUTING.md <CONTRIBUTING.md>`_.
| Please follow the workflow described in the `CONTRIBUTING.md <https://rl-institut.github.io/super-repo/latest/development/collaboration/>`_.

Contributors:

.. figure:: https://contrib.rocks/image?repo=rl-institut/super-repo
:align: left
:target: https://github.com/rl-institut/super-repo/graphs/contributors
:alt: [contrib.rocks](https://contrib.rocks)

License and Citation
====================
| The code of this repository is licensed under the **MIT License** (MIT).
| See `LICENSE.txt <LICENSE.txt>`_ for rights and obligations.
| See the *Cite this repository* function or `CITATION.cff <CITATION.cff>`_ for citation of this repository.
| See the *Cite this repository* function or `CITATION.cff <https://github.com/rl-institut/super-repo/blob/production/CITATION.cff>`_ for citation of this repository.
| Copyright: `super-repo <https://github.com/rl-institut/super-repo/>`_ © `Reiner Lemoine Institut <https://reiner-lemoine-institut.de/>`_ | `MIT <LICENSE.txt>`_


Expand All @@ -67,35 +74,58 @@ License and Citation
:target: https://api.reuse.software/info/github.com/rl-institut/super-repo
:alt: REUSE

.. |badge_documentation| image:: https://img.shields.io/github/actions/workflow/status/rl-institut/super-repo/gh-pages.yml?branch=production
.. |badge_documentation| image:: https://img.shields.io/github/actions/workflow/status/rl-institut/super-repo/documentation.yml?branch=develop
:target: https://rl-institut.github.io/super-repo/
:alt: Documentation

.. |badge_codecov| image:: https://codecov.io/gh/rl-institut/super-repo/branch/feature-61-codecov/graph/badge.svg?token=YYCJI3D5G5
.. |badge_tests| image:: https://github.com/rl-institut/super-repo/actions/workflows/automated-testing.yaml/badge.svg
:target: https://github.com/rl-institut/super-repo/actions/workflows/automated-testing.yaml
:alt: Documentation

.. |badge_codecov| image:: https://codecov.io/gh/rl-institut/super-repo/graph/badge.svg?token=YYCJI3D5G5
:target: https://codecov.io/gh/rl-institut/super-repo
:alt: Codecov

.. |badge_pypi| image:: https://img.shields.io/pypi/v/super-repo
:target: https://pypi.org/project/super-repo/
:alt: PyPI Version

.. |badge_python| image:: https://img.shields.io/pypi/pyversions/super-repo
:target: https://pypi.org/project/super-repo/
:alt: PyPI Python Version

.. |badge_pypi_downloads| image:: https://img.shields.io/pypi/dm/super-repo
:target: https://pypi.org/project/super-repo/
:alt: PyPI Downloads

.. |badge_contributing| image:: https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat
:target: https://github.com/rl-institut/super-repo/blob/develop/CONTRIBUTING.md
:alt: contributions

.. |badge_repo_counts| image:: http://hits.dwyl.com/rl-institut/super-repo.svg
:target: http://hits.dwyl.com/rl-institut/super-repo
:alt: counter

.. |badge_contributors| image:: https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square
.. |badge_contributors| image:: https://img.shields.io/github/contributors/rl-institut/super-repo
:target: https://github.com/rl-institut/super-repo/graphs/contributors
:alt: contributors

.. |badge_issue_open| image:: https://img.shields.io/github/issues-raw/rl-institut/super-repo
:target: https://github.com/rl-institut/super-repo/issues
:alt: open issues

.. |badge_issue_closes| image:: https://img.shields.io/github/issues-closed-raw/rl-institut/super-repo
:target: https://github.com/rl-institut/super-repo/issues?q=is%3Aissue+is%3Aclosed
:alt: closes issues

.. |badge_pr_open| image:: https://img.shields.io/github/issues-pr-raw/rl-institut/super-repo
:target: https://github.com/rl-institut/super-repo/pulls
:alt: closes issues

.. |badge_pr_closes| image:: https://img.shields.io/github/issues-pr-closed-raw/rl-institut/super-repo
:target: https://github.com/rl-institut/super-repo/pulls?q=is%3Apr+is%3Aclosed
:alt: closes issues

.. |badge_matrix| image:: https://img.shields.io/matrix/super-repo:matrix.org
:target: https://img.shields.io/matrix/super-repo%3Amatrix.org
:target: https://app.element.io/#/room/#super-repo:matrix.org
:alt: Matrix
23 changes: 14 additions & 9 deletions RELEASE_PROCEDURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ For a **Patch Release** (Hotfix), start at [section 3](https://github.com/rl-ins
- `📝CITATION.cff`
- Update `version`
- Update `date-released`
- `📝setup.py`
- `📝pyproject.toml`
- Update `version`
- Update `download_url` (.../v0.1.0.tar.gz)

Expand Down Expand Up @@ -179,17 +179,22 @@ If you messed up, remove tags and start again

### 1. 💻 Create and publish package on PyPI

- Navigate to git folder `cd D:\git\github\GROUP\REPO\`
- Create package using `python setup.py sdist`
- Check that file has been created in folder `dist`
- Activate python environment `activate release_py38`
- Upload to PyPI using `twine upload dist/NAME_0.5.1.tar.gz`
- Enter `name` and `password`
- Check on PyPI if release arrived
- Breath three times and smile
💻 `cd D:\git\github\USER\REPO\` Navigate to git folder <br>
💻 `activate py310` Activate conda environment <br>
💻 `python -m build` Create package using <br>
📝 `dist` Check that files have been created in folder <br>
💻 `twine check dist/*` Check build <br>
💻 `twine upload -r testpypi dist/NAME_0.2.0.tar.gz` Upload to Test PyPI using <br>
💻 `twine upload dist/NAME_0.2.0.tar.gz` Upload to PyPI using <br>
💻 Enter `name` and `password` <br>
🎉 Check on PyPI if release arrived, breath three times and smile!

▶️ Publish the Package

## Sources:

- https://raw.githubusercontent.com/folio-org/stripes/master/doc/release-procedure.md


!!! note "Used Icons"
🐙 GitHub | 💠 git | 📝 File | 💻 Command Line
36 changes: 31 additions & 5 deletions docs/code/install/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
# Install

- requirements.txt
- requirements_dev.txt
- environment.yml
- setup.py
- pyproject.toml
## Environment (Conda)

With conda, you can create, export, list, remove, and update environments
that have different versions of Python and/or packages installed in them. <br>
Switching or moving between environments is called activating the environment.
You can also share an environment file and import from `requirements.txt`.

💻 `conda env create -f environment.yml` Create conda environment <br>
💻 `activate py310` Activate environment <br>
💻 `python --version` Check python version


## Requirements

In Python the `requirements.txt` file helps manage dependencies.
It's a text file that lists the packages that the Python project depends on.

💻 `pip install -r requirements.txt` Install from file


## Pyproject

This python package contains a `pyproject.toml` file that contains
build system requirements and information, which are
[used by pip](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/)
to build the package.
It contains the metadata of the software project.


!!! note "Used Icons"
🐙 GitHub | 💠 git | 📝 File | 💻 Command Line
4 changes: 3 additions & 1 deletion docs/development/collaboration/users.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Users

Known user of this software can be added to [USERS.cff](https://github.com/rl-institut/super-repo/blob/production/USERS.cff) for reference.
Known user of this software can be added to
[USERS.cff](https://github.com/rl-institut/super-repo/blob/production/USERS.cff)
for reference.
5 changes: 3 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ and documentation.

- COLLABORATION
- GIT
- CODE-STYLE
- DOCUMENTATION
- RELEASE

### Fields for code documentation

Methods and standards of the module.
Methods and functions of the module.

- INSTALL
- CODE-STYLE
- FUNCTIONS
- TESTS
- LOGGING
13 changes: 13 additions & 0 deletions environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: Ludwig Hülk <@Ludee> © Reiner Lemoine Institut
#
# SPDX-License-Identifier: MIT

name: py310
channels:
- conda-forge
dependencies:
- python=3.10
- anaconda
- pip
- pip:
- -r file:requirements.txt
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ nav:
- development/git/index.md
- Continuous Integration:
- development/continuous-integration/index.md
- Code Style:
- code/style/index.md
- Documentation:
- development/documentation/index.md
- Release:
- development/release/index.md
- Code Documentation:
- Install:
- code/install/index.md
- Code Style:
- code/style/index.md
- Functions:
- code/index.md
- code/code_example.md
16 changes: 13 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,27 @@ description = "A template repo for research software."
readme = "README.rst"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"stringcase ~=1.2.0",
]
license = {text = "MIT"}

[project.urls]
Homepage = "https://github.com/rl-institut/super-repo"
Documentation = "https://rl-institut.github.io/super-repo/latest/"
Changelog = "https://github.com/rl-institut/super-repo/blob/production/CHANGELOG.md"
"Issue Tracker" = "https://github.com/rl-institut/super-repo/issues"

lint = [
"ruff",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ mkdocs
mkdocs-material
mkdocstrings
mkdocstrings-python-legacy
mike
pre-commit
pytest
pytest-cov
tox
mike
ruff