Skip to content

Commit 71c806e

Browse files
committed
Prepare for PyPI release and documentation
1 parent d09969f commit 71c806e

File tree

16 files changed

+885
-11
lines changed

16 files changed

+885
-11
lines changed

.github/workflows/pypi-publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write # This is required for trusted publishing
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.10'
22+
23+
- name: Install build tools
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install build twine
27+
28+
- name: Build package
29+
run: |
30+
python -m build
31+
32+
- name: Publish to PyPI
33+
uses: pypa/gh-action-pypi-publish@release/v1
34+
with:
35+
user: __token__
36+
password: ${{ secrets.PYPI_API_TOKEN }}
37+
skip_existing: true
38+
verbose: true

.github/workflows/tests.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
schedule:
9+
- cron: '0 0 * * 0' # Weekly on Sundays
10+
11+
defaults:
12+
run:
13+
shell: bash -l {0}
14+
15+
jobs:
16+
test:
17+
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest]
23+
python-version: ['3.8', '3.9', '3.10', '3.11']
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -e .[dev]
37+
38+
- name: Run tests
39+
run: |
40+
python -m pytest tests/ -v --cov=fma_ions --cov-report=xml
41+
42+
- name: Upload coverage to Codecov
43+
uses: codecov/codecov-action@v4
44+
with:
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
file: ./coverage.xml
47+
fail_ci_if_error: false
48+
49+
- name: Run type checking
50+
run: |
51+
mypy fma_ions/
52+
53+
- name: Lint with flake8
54+
run: |
55+
flake8 fma_ions/
56+
57+
- name: Check formatting with black
58+
run: |
59+
black --check fma_ions/

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ share/python-wheels/
4747
*.egg
4848
MANIFEST
4949

50+
# Requirements files
51+
requirements*.txt
52+
!requirements-docs.txt
53+
5054
# PyInstaller
5155
# Usually these files are written by a python script from a template
5256
# before PyInstaller builds the exe, so as to inject date/other infos into it.

.readthedocs.yaml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
version: 2
6+
7+
# Build documentation in the docs/ directory with Sphinx
8+
sphinx:
9+
configuration: docs/conf.py
10+
fail_on_warning: true
11+
builder: html
12+
13+
# Build documentation with MkDocs
14+
#mkdocs:
15+
# configuration: mkdocs.yml
16+
17+
# Optionally build your docs in additional formats such as PDF and ePub
18+
formats:
19+
- pdf
20+
- epub
21+
22+
# Optionally set the version of Python and requirements required to build your docs
23+
python:
24+
version: "3.10"
25+
install:
26+
- requirements: requirements-docs.txt
27+
- method: pip
28+
path: .
29+
extra_requirements:
30+
- docs
31+
32+
# Optionally build documentation for specific branches and tags
33+
# branches:
34+
# main:
35+
# name: main
36+
# latest:
37+
# name: latest
38+
# stable:
39+
# name: stable
40+
# type: tag
41+
42+
# Optionally include additional paths in the build
43+
tools:
44+
apt_packages:
45+
- graphviz
46+
- texlive-latex-extra
47+
- texlive-fonts-recommended
48+
- latexmk
49+
- dvipng
50+
51+
# Build documentation with Sphinx v2 by default
52+
sphinx:
53+
configuration: docs/conf.py
54+
fail_on_warning: false
55+
56+
# Build PDF and ePub too
57+
formats: all
58+
59+
# Optionally set the version of Python and requirements required to build your docs
60+
python:
61+
version: 3.10
62+
install:
63+
- method: pip
64+
path: .
65+
extra_requirements:
66+
- docs
67+
68+
# Optionally build documentation for specific branches and tags
69+
build:
70+
os: ubuntu-22.04
71+
tools:
72+
python: "3.10"
73+
jobs:
74+
post_create_environment:
75+
- pip install -U pip
76+
- pip install -U setuptools wheel
77+
78+
# Optionally include additional paths in the build
79+
sphinx:
80+
configuration: docs/conf.py
81+
builder: html
82+
fail_on_warning: false
83+
jobs:
84+
post_build:
85+
- echo "Documentation built successfully!"
86+
87+
# Optionally include additional paths in the build
88+
tools:
89+
apt_packages:
90+
- graphviz
91+
- texlive-latex-extra
92+
- texlive-fonts-recommended
93+
- latexmk
94+
- dvipng
95+
- texlive-latex-recommended
96+
- texlive-fonts-extra
97+
- texlive-latex-extra
98+
- latex-cjk-all
99+
- latex-xcolor
100+
- latex-ucs
101+
- latex-ucs-doc
102+
- latex-ucs-utils
103+
- latex-ucs-extra
104+
- latex-ucs-extra-doc
105+
- latex-ucs-extra-utils
106+
- latex-ucs-extra-extra
107+
- latex-ucs-extra-extra-doc
108+
- latex-ucs-extra-extra-utils

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
### Added
10+
- Initial project setup with basic structure
11+
- GitHub Actions workflows for testing and deployment
12+
- Sphinx documentation setup
13+
- Contribution guidelines and code of conduct
14+
- PyPI packaging configuration
15+
16+
### Changed
17+
- Updated project metadata and dependencies
18+
- Improved code organization and documentation
19+
20+
### Fixed
21+
- Various bug fixes and improvements
22+
23+
## [0.1.0] - 2024-06-03
24+
### Added
25+
- Initial release of fma_ions
26+
- Basic functionality for Frequency Map Analysis of ion beams
27+
- Support for CERN accelerators (SPS, PS, LEIR)
28+
- GPU acceleration support
29+
- Documentation and examples

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
* Using welcoming and inclusive language
12+
* Being respectful of differing viewpoints and experiences
13+
* Gracefully accepting constructive criticism
14+
* Focusing on what is best for the community
15+
* Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
* Trolling, insulting/derogatory comments, and personal or political attacks
21+
* Public or private harassment
22+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
* Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28+
29+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [INSERT EMAIL ADDRESS]. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

0 commit comments

Comments
 (0)