Skip to content

Commit

Permalink
Merge pull request #136 from twosigma/releng
Browse files Browse the repository at this point in the history
refresh release engineering
  • Loading branch information
leifwalsh authored Dec 20, 2023
2 parents 92c254e + 1cc65fe commit 33b3bd0
Show file tree
Hide file tree
Showing 76 changed files with 1,783 additions and 1,073 deletions.
5 changes: 3 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ coverage:
default:
target: auto
threshold: null
base: auto
base: auto

comment: false
comment:
require_changes: true
22 changes: 22 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.191.0/containers/python-3/.devcontainer/base.Dockerfile

# [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6
ARG VARIANT="3.10"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

# [Choice] Node.js version: none, lts, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] If your pip requirements rarely change, uncomment this section to add them to the image.
#COPY requirements-dev.txt /tmp/pip-tmp/
#RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements-dev.txt \
# && rm -rf /tmp/pip-tmp
RUN pip3 --disable-pip-version-check --no-cache-dir install pip-tools

# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends ripgrep

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
58 changes: 58 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.191.0/containers/python-3
{
"name": "Python 3",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Update 'VARIANT' to pick a Python version: 3, 3.6, 3.7, 3.8, 3.9
"VARIANT": "3.8",
// Options
"NODE_VERSION": "none"
}
},
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"black-formatter.path": ["/usr/local/py-utils/bin/black"],
"flake8.path": ["/usr/local/py-utils/bin/flake8"],
"mypy-type-checker.path": ["/usr/local/py-utils/bin/mypy"],
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/.coverage": true,
"**/.coverage.*": true,
"**/*.egg-info": true,
".eggs": true,
".tox": true,
"**/dist": true,
"**/__pycache__": true
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.flake8",
"ms-python.black-formatter",
"ms-python.mypy-type-checker",
"tamasfe.even-better-toml",
"lextudio.restructuredtext",
"trond-snekvik.simple-rst"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements/dev.txt && pip3 install --user -e marbles/core -e marbles/mixins",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _What new tests were added to cover new features or behaviors?_
_Make sure you did the following (if applicable):_
- [ ] Signed and returned a copy of the [CLA](https://github.com/twosigma/marbles/tree/master/cla)
- [ ] Added tests for any new features or behaviors
- [ ] Ran ``tox -e flake8`` to make sure code style is consistent
- [ ] Ran ``nox -s flake8`` to make sure code style is consistent
- [ ] Built and reviewed the docs
- [ ] Added a note to the [changelog](https://github.com/twosigma/marbles/blob/master/docs/changelog.rst)

Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/devcontainer-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Devcontainer CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Run devcontainer task
uses: devcontainers/[email protected]
with:
runCmd: nox
15 changes: 15 additions & 0 deletions .github/workflows/documentation-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Read the Docs Pull Request Preview
on:
pull_request:
branches: [main]

permissions:
pull-requests: write

jobs:
documentation-links:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: marbles
88 changes: 88 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
GITHUB_ACTIONS: 1

jobs:
test:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

runs-on: ${{ matrix.platform }}

env:
PLATFORM: ${{ matrix.platform }}
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox
- name: Test
run: nox -p ${PYTHON} -t actions-test
if: ${{ matrix.platform != 'windows-latest' }}
- name: Test
run: nox -p ${env:PYTHON} -t actions-test
if: ${{ matrix.platform == 'windows-latest' }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: PLATFORM,PYTHON
files: ./coverage.xml

check:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8"]

runs-on: ${{ matrix.platform }}

env:
PLATFORM: ${{ matrix.platform }}
PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install nox
- name: Lint, build docs, and package
run: nox -t actions-check
- name: Upload docs
uses: actions/upload-artifact@v3
with:
name: docs-${{ matrix.platform }}
path: build/sphinx/html
- name: Upload packages
uses: actions/upload-artifact@v3
with:
name: packages-${{ matrix.platform }}
path: |
dist
marbles/core/dist
marbles/mixins/dist
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ dist/
coverage.xml
*.pyc
.eggs
.tox/
.venv/
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

141 changes: 141 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run nox",
"type": "shell",
"command": "nox",
"args": [
"--python",
"3.8"
],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": false,
"group": {
"kind": "test",
"isDefault": true
}
},
{
"label": "Run coverage",
"type": "shell",
"command": "nox",
"args": [
"--python",
"3.8",
"--session",
"coverage"
],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": false,
"group": {
"kind": "test",
"isDefault": false
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
},
"problemMatcher": []
},
{
"label": "Serve coverage",
"type": "shell",
"command": "nox",
"args": [
"--session",
"serve_coverage"
],
"options": {
"cwd": "${workspaceFolder}"
},
"group": "none",
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
},
"problemMatcher": [],
"isBackground": true,
"dependsOn": [
"Run coverage"
]
},
{
"label": "Build docs",
"type": "shell",
"command": "nox",
"args": [
"--session",
"docs"
],
"options": {
"cwd": "${workspaceFolder}"
},
"isBackground": false,
"group": {
"kind": "build",
"isDefault": false
},
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
},
"problemMatcher": {
"owner": "rst",
"applyTo": "allDocuments",
"fileLocation": "autoDetect",
"pattern": {
"regexp": "^(.*):(\\d+):\\s*([A-Za-z]*):(.*)$",
"file": 1,
"location": 2,
"severity": 3,
"message": 4
}
}
},
{
"label": "Serve docs",
"type": "shell",
"command": "nox",
"args": [
"--session",
"serve_docs"
],
"options": {
"cwd": "${workspaceFolder}"
},
"group": "none",
"presentation": {
"echo": true,
"reveal": "never",
"focus": false,
"panel": "dedicated",
"showReuseMessage": false,
"clear": true
},
"problemMatcher": [],
"isBackground": true,
"dependsOn": [
"Build docs"
]
}
]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2018 Two Sigma Open Source, LLC
Copyright (c) 2018-2023 Two Sigma Open Source, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
Loading

0 comments on commit 33b3bd0

Please sign in to comment.