Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ku1ik committed May 7, 2022
2 parents e08109f + 76303b2 commit f3af768
Show file tree
Hide file tree
Showing 55 changed files with 2,544 additions and 1,449 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,7 @@
---
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
110 changes: 88 additions & 22 deletions .github/workflows/asciinema.yml
@@ -1,44 +1,110 @@
---
name: build

on: [push, pull_request]

on:
- push
- pull_request
jobs:
# Code style checks
health:
name: Code health check
name: code health check
runs-on: ubuntu-latest
steps:
- name: Checkout Asciinema
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- name: checkout asciinema
uses: actions/checkout@v3
- name: setup Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install dependencies
run: pip install pycodestyle twine setuptools>=38.6.0 cmarkgfm
python-version: "3.10"
- name: install dependencies
run: pip install build cmarkgfm pycodestyle twine
- name: Run pycodestyle
run: find . -name \*.py -exec pycodestyle --ignore=E501,E402,E722 {} +
run: >
find .
-name '*\.py'
-exec pycodestyle --ignore=E402,E501,E722,W503 "{}" \+
- name: Run twine
run: |
python setup.py --quiet sdist
python3 -m build
twine check dist/*
# Asciinema checks
asciinema:
name: Asciinema - py${{ matrix.python }}
name: Asciinema
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.6, 3.7, 3.8, 3.9]
python:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
env:
TERM: dumb
steps:
- name: Checkout Asciinema
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- name: checkout Asciinema
uses: actions/checkout@v3
- name: setup Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install nose
- name: Run Asciinema tests
- name: install dependencies
run: pip install pytest
- name: run Asciinema tests
run: script -e -c make test
build_distros:
name: build distro images
strategy:
matrix:
distros:
- alpine
- arch
- centos
- debian
- fedora
- ubuntu
runs-on: ubuntu-latest
steps:
- name: Set up Docker buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Authenticate to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: "Build ${{ matrix.distros }} image"
uses: docker/build-push-action@v3
with:
file: "tests/distros/Dockerfile.${{ matrix.distros }}"
tags: |
"ghcr.io/${{ github.repository }}:${{ matrix.distros }}"
push: true
test_distros:
name: integration test distro images
needs: build_distros
strategy:
matrix:
distros:
- alpine
- arch
- centos
- debian
- fedora
- ubuntu
runs-on: ubuntu-latest
container:
image: "ghcr.io/${{ github.repository }}:${{ matrix.distros }}"
credentials:
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
# https://github.community/t/permission-problems-when-checking-out-code-as-part-of-github-action/202263
options: "--interactive --tty --user=1001:121"
steps:
- name: checkout Asciinema
uses: actions/checkout@v3
- name: run integration tests
env:
TERM: dumb
shell: 'script --return --quiet --command "bash {0}"'
run: make test.integration
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
@@ -0,0 +1,14 @@
---
name: pre-commit
on:
- pull_request
- push
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.10"
- uses: pre-commit/action@v2.0.3
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,39 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-ast
- id: check-json
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
hooks:
- id: yamllint
- repo: https://github.com/myint/autoflake
rev: v1.4
hooks:
- id: autoflake
args:
- --in-place
- --recursive
- --expand-star-imports
- --remove-all-unused-imports
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.931"
hooks:
- id: mypy
15 changes: 14 additions & 1 deletion CHANGELOG.md
@@ -1,5 +1,19 @@
# asciinema changelog

## 2.2.0 (2022-05-07)

* Added official support for Python 3.8, 3.9, 3.10
* Dropped official support for Python 3.5
* Added `--cols` / `--rows` options for overriding size of pseudo-terminal reported to recorded program
* Improved behaviour of `--append` when output file doesn't exist
* Keyboard input is now explicitly read from a TTY device in addition to stdin (when stdin != TTY)
* Recorded program output is now explicitly written to a TTY device instead of stdout
* Dash char (`-`) can now be passed as output filename to write asciicast to stdout
* Diagnostic messages are now printed to stderr (without colors when stderr != TTY)
* Improved robustness of writing asciicast to named pipes
* Lots of codebase modernizations (many thanks to Davis @djds Schirmer!)
* Many other internal refactorings

## 2.1.0 (2021-10-02)

* Ability to pause/resume terminal capture with `C-\` key shortcut
Expand All @@ -12,7 +26,6 @@
* Upload for users with very long `$USER` is fixed
* Added official support for Python 3.8 and 3.9
* Dropped official support for EOL-ed Python 3.4 and 3.5
* Internal refactorings

## 2.0.2 (2019-01-12)

Expand Down
51 changes: 33 additions & 18 deletions CONTRIBUTING.md
@@ -1,49 +1,64 @@
# Contributing to asciinema

First, if you're opening a Github issue make sure it goes to the correct repository:
First, if you're opening a GitHub issue make sure it goes to the correct
repository:

* [asciinema/asciinema](https://github.com/asciinema/asciinema/issues) - command-line recorder
* [asciinema/asciinema-server](https://github.com/asciinema/asciinema-server/issues) - public website hosting recordings
* [asciinema/asciinema-player](https://github.com/asciinema/asciinema-player/issues) - player
- [asciinema/asciinema](https://github.com/asciinema/asciinema/issues) - command-line recorder
- [asciinema/asciinema-server](https://github.com/asciinema/asciinema-server/issues) - public website hosting recordings
- [asciinema/asciinema-player](https://github.com/asciinema/asciinema-player/issues) - player

## Reporting bugs

Open an issue in Github issue tracker.
Open an issue in GitHub issue tracker.

Tell us what's the problem and include steps to reproduce it (reliably).
Including your OS/browser/terminal name and version in the report would be great.
Including your OS/browser/terminal name and version in the report would be
great.

## Submitting patches with bug fixes

If you found a bug and made a patch for it:

* make sure all tests pass
* send us a pull request, including a description of the fix (referencing an existing issue if there's one)
1. Make sure your changes pass the [pre-commit](https://pre-commit.com/)
[hooks](.pre-commit-config.yaml). You can install the hooks in your work
tree by running `pre-commit install` in your checked out copy.
1. Make sure all tests pass. If you add new functionality, add new tests.
1. Send us a pull request, including a description of the fix (referencing an
existing issue if there's one).

## Requesting new features

We welcome all ideas.
If you believe most asciinema users would benefit from implementing your idea then feel free to open a Github issue.
However, as this is an open-source project maintained by a small team of volunteers we simply can't implement all of them due to limited resources. Please keep that in mind.

If you believe most asciinema users would benefit from implementing your idea
then feel free to open a GitHub issue. However, as this is an open-source
project maintained by a small team of volunteers we simply can't implement all
of them due to limited resources. Please keep that in mind.

## Proposing features/changes (pull requests)

If you want to propose code change, either introducing a new feature or improving an existing one, please first discuss this with asciinema team. You can simply open a separate issue for a discussion or join #asciinema IRC channel on freenode.
If you want to propose code change, either introducing a new feature or
improving an existing one, please first discuss this with asciinema team. You
can simply open a separate issue for a discussion or join #asciinema IRC
channel on Libera.Chat.

## Asking for help

Github issue tracker is not a support forum.
GitHub issue tracker is not a support forum.

If you need help then either join #asciinema IRC channel on libera.chat or drop
us an email at support@asciinema.org.
If you need help then either join #asciinema IRC channel on Libera.Chat or
drop us an email at <support@asciinema.org>.

## Reporting security issues

If you found a security issue in asciinema please contact us at support@asciinema.org.
For the benefit of all asciinema users please **do not** publish details of the vulnerability in a Github issue.
If you found a security issue in asciinema please contact us at
support@asciinema.org. For the benefit of all asciinema users please **do
not** publish details of the vulnerability in a GitHub issue.

The PGP key below (1eb33a8760dec34b) can be used when sending encrypted email to or verifying responses from support@asciinema.org.
The PGP key below (1eb33a8760dec34b) can be used when sending encrypted email
to or verifying responses from support@asciinema.org.

```
```Public Key
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v2
Expand Down
50 changes: 33 additions & 17 deletions Dockerfile
@@ -1,22 +1,38 @@
FROM ubuntu:20.04

RUN apt-get update && apt-get install -y \
ca-certificates \
locales \
python3 \
python3-setuptools
RUN localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
RUN mkdir /usr/src/app
COPY setup.cfg /usr/src/app
COPY setup.py /usr/src/app
COPY *.md /usr/src/app/
# syntax=docker/dockerfile:1.3

FROM docker.io/library/ubuntu:20.04

ENV DEBIAN_FRONTEND="noninteractive"

RUN apt-get update \
&& apt-get install -y \
ca-certificates \
locales \
python3 \
python3-pip \
&& localedef \
-i en_US \
-c \
-f UTF-8 \
-A /usr/share/locale/locale.alias \
en_US.UTF-8

COPY pyproject.toml setup.cfg *.md /usr/src/app/
COPY doc/*.md /usr/src/app/doc/
COPY man/asciinema.1 /usr/src/app/man/
COPY asciinema /usr/src/app/asciinema
COPY asciinema/ /usr/src/app/asciinema/
COPY README.md LICENSE /usr/src/app/

WORKDIR /usr/src/app
RUN python3 setup.py install
ENV LANG en_US.utf8
ENV SHELL /bin/bash
ENV USER docker

RUN pip3 install .

WORKDIR /root

ENV LANG="en_US.utf8"
ENV SHELL="/bin/bash"

ENTRYPOINT ["/usr/local/bin/asciinema"]
CMD ["--help"]

# vim:ft=dockerfile

0 comments on commit f3af768

Please sign in to comment.