Skip to content

Commit

Permalink
Merge branch 'master' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ifilot committed Nov 26, 2023
2 parents 4107e0a + 6fa3827 commit 3d81430
Show file tree
Hide file tree
Showing 19 changed files with 514 additions and 261 deletions.
86 changes: 15 additions & 71 deletions .github/workflows/build.yml → .github/workflows/build_conda.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
name: build
name: Build Conda packages

on:
push:
branches: [ "master", "develop" ]
workflow_dispatch:
pull_request:
branches: [ "master", "develop" ]
push:
branches:
- master
- develop
tags:
- "v**"
release:
types:
- published

jobs:
check-version-strings:
Expand All @@ -21,57 +28,6 @@ jobs:
run: |
python deploy/check_version.py
#-------------------------------------------------------------------------------
# PyPI / Linux
#-------------------------------------------------------------------------------
build-pypi-linux:
needs: check-version-strings
runs-on: ubuntu-latest
container: quay.io/pypa/manylinux2014_x86_64

steps:
- name: Install dependencies
run: |
yum -y install libgomp glm-devel gcc
ls -alh /opt/python/cp*
/opt/python/cp37-cp37m/bin/python -m pip install numpy tqdm cython pytest
/opt/python/cp38-cp38/bin/python -m pip install numpy tqdm cython pytest
/opt/python/cp39-cp39/bin/python -m pip install numpy tqdm cython pytest
/opt/python/cp310-cp310/bin/python -m pip install numpy tqdm cython pytest
/opt/python/cp311-cp311/bin/python -m pip install numpy tqdm cython pytest
- name: Checkout repo
uses: actions/checkout@v3
- name: Build
run: ./deploy/docker_setup_github.sh
- name: Test
run: ./deploy/docker_test_github.sh
- name: Archive wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: wheelhouse/pytessel-*.whl

pypi-publish:
name: Upload release to PyPI
if: github.ref == 'refs/heads/master'
needs: build-pypi-linux
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pytessel
permissions:
id-token: write
steps:
- name: Retrieve packages
uses: actions/download-artifact@v3
with:
name: wheels
path: wheelhouse
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: wheelhouse/

#-------------------------------------------------------------------------------
# Anaconda / Windows
#-------------------------------------------------------------------------------
Expand All @@ -93,14 +49,6 @@ jobs:
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Download GLM
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: "https://github.com/g-truc/glm/releases/download/0.9.9.8/glm-0.9.9.8.zip"
- name: Unzip GLM
shell: bash -l {0}
run: |
7z x glm-0.9.9.8.zip
- name: Build
shell: bash -l {0}
run: |
Expand All @@ -114,7 +62,7 @@ jobs:

anaconda-publish:
name: Publish Anaconda / Windows
if: github.ref == 'refs/heads/master'
if: startsWith(github.ref, 'refs/tags/v')
needs: build-anaconda-windows
runs-on: ubuntu-latest
environment:
Expand Down Expand Up @@ -154,7 +102,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential libglm-dev libboost-all-dev
run: sudo apt-get update && sudo apt-get install -y build-essential
- name: Set-up miniconda
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -174,7 +122,7 @@ jobs:

publish-anaconda-linux:
name: Publish Anaconda / Linux
if: github.ref == 'refs/heads/master'
if: startsWith(github.ref, 'refs/tags/v')
needs: build-anaconda-linux
runs-on: ubuntu-latest
environment:
Expand Down Expand Up @@ -213,10 +161,6 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: |
brew install glm
brew install boost
- name: Set-up miniconda
uses: conda-incubator/setup-miniconda@v2
with:
Expand All @@ -236,7 +180,7 @@ jobs:

publish-anaconda-macos:
name: Publish Anaconda / MacOS
if: github.ref == 'refs/heads/master'
if: startsWith(github.ref, 'refs/tags/v')
needs: build-anaconda-macos
runs-on: ubuntu-latest
environment:
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build PyPI packages

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
- develop
tags:
- "v**"
release:
types:
- published

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, windows-2022, macos-11]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,4 @@ wheelhouse/*
test.py
nose_debug
test.ply
.vscode
92 changes: 92 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Pull Request Process

1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Update the README.md with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
3. Increase the version numbers in any examples files and the README.md to the new version that this
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
do not have permission to do that, you may request the second reviewer to merge it for you.

## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making 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.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

### Our Responsibilities

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.

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.

### Scope

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.

### Enforcement

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.

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.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# PyTessel

[![C/C++ CI](https://github.com/ifilot/pytessel/actions/workflows/build.yml/badge.svg)](https://github.com/ifilot/pytessel/actions/workflows/build.yml)
[![CI](https://github.com/ifilot/pytessel/actions/workflows/build_conda.yml/badge.svg)](https://github.com/ifilot/pytessel/actions/workflows/build_Conda.yml)
[![CI](https://github.com/ifilot/pytessel/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/ifilot/pytessel/actions/workflows/build_wheels.yml)
[![Anaconda-Server Badge](https://anaconda.org/ifilot/pytessel/badges/version.svg)](https://anaconda.org/ifilot/pytessel)
[![PyPI](https://img.shields.io/pypi/v/pytessel?color=green)](https://pypi.org/project/pytessel/)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
Expand Down Expand Up @@ -140,5 +141,5 @@ if __name__ == '__main__':
## Local compilation (Linux)

```bash
python3 setup.py build_ext --inplace
python3 setup.py build_ext --inplace bdist
```
2 changes: 1 addition & 1 deletion meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package:
name: "pytessel"
version: "1.0.2"
version: "1.1.0"

source:
path: .
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"Cython",
"numpy",
]
build-backend = "setuptools.build_meta"

[tool.cibuildwheel]
test-requires = "pytest"
test-command = "pytest {project}/tests"

# skip PyPy wheels
skip = ["pp*"]
2 changes: 1 addition & 1 deletion pytessel/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.0.2"
__version__ = "1.1.0"
Loading

0 comments on commit 3d81430

Please sign in to comment.