Commit graph

40 commits

Author SHA1 Message Date
Zsolt Dollenstein
1995e70c5e
[ci] Fix pypi_upload workflow
pypi_upload has been broken since #810, because `actions/checkout` defaults to a shallow checkout that only checks out the revision triggering the workflow. This causes setuptools-scm to miss the most recent tag, causing the version to be detected as `0.1`.
2023-03-08 21:45:48 +00:00
Amethyst Reese
5ccba6b0d3
Use new setup-python caching actions (#874)
With the latest setup-python actions, there is a better caching
mechanism available that also requires less setup, and provides better
fallback behavior that should help avoid the random CI failures that
have been happening on 3.11 for setuptools-rust. This ensures that we
install the necessary dependencies before attempting to build the
package or run tests, while still enabling speedups in best case
scenario when requirements files haven't changed.

See the upstream readme for details:
https://github.com/actions/setup-python#caching-packages-dependencies
2023-03-08 11:14:43 +00:00
Amethyst Reese
d94687e378
Script to regenerate test fixtures (#872)
Upgrading Pyre requires updating test fixtures with any upstream changes
to Pyre's query results for the `simple_class.py` fixture.

This adds a new `scripts/` directory to the repo, with a script to
regenerate test fixtures. The script regenerates the cache data fixture,
and updates the `TypeInferenceProvider` tests to use `assertDictEqual`
and helpful error messages for better behavior in future mismatches.

This also includes a slight bump to Pyre 0.9.10 to fix install issues on
Apple Silicon M1 Macs, and regenerated fixtures using the script above.
2023-02-22 12:35:23 -08:00
dependabot[bot]
bfd8e495ac
Bump pypa/cibuildwheel from 2.11.2 to 2.12.0 (#857)
Bumps [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel) from 2.11.2 to 2.12.0.
- [Release notes](https://github.com/pypa/cibuildwheel/releases)
- [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md)
- [Commits](https://github.com/pypa/cibuildwheel/compare/v2.11.2...v2.12.0)

---
updated-dependencies:
- dependency-name: pypa/cibuildwheel
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 13:50:19 +00:00
dependabot[bot]
987aff6664
Bump actions/cache from 2 to 3 (#820)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-14 10:40:06 +00:00
dependabot[bot]
667c0c3e14
Bump actions/setup-python from 2 to 4 (#819)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-14 10:39:48 +00:00
dependabot[bot]
a284947b8f
Bump actions/checkout from 1 to 3 (#810)
Bumps [actions/checkout](https://github.com/actions/checkout) from 1 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-11 09:04:21 +00:00
dependabot[bot]
ede2616ff2
Bump actions/download-artifact from 2 to 3 (#815)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-10 21:51:18 +00:00
dependabot[bot]
b62ce9218f
Bump codecov/codecov-action from 2 to 3 (#812)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-10 21:50:54 +00:00
dependabot[bot]
fc6e0c6a64
Bump actions/upload-artifact from 2 to 3 (#811)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-10 10:27:36 +00:00
Zsolt Dollenstein
95e65a4022
Remove deprecated ::set-output directive (#808) 2022-11-10 10:13:22 +00:00
Vincent Fazio
1e88f1ed42
Python 3.11 wheels (#801)
* [ci] narrow python 3.11 version window

Also, quote the versions for consistency.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>

* [ci] bump cibuildwheel to 2.11.2

Newer versions support building 3.11 wheels automatically, so just take
the latest currently available.

Signed-off-by: Vincent Fazio <vfazio@gmail.com>

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
2022-11-02 16:25:47 +00:00
Zsolt Dollenstein
1f5f16aa77
Skip CI checks on Python 3.11 x Windows (#752)
There are no available binary wheels for lxml for Windows & Python 3.11 yet:
https://bugs.launchpad.net/lxml/+bug/1977998

Until that's resolved, let's skip tests in this configuration.
2022-08-17 14:00:48 +01:00
Zsolt Dollenstein
367b14b052
test using python 3.11 beta versions (#723) 2022-07-15 15:26:58 +01:00
Zsolt Dollenstein
ff5fcf8dfb
Update pypi_upload.yml
Remove prod repo url override
2022-06-13 19:29:56 +01:00
Zsolt Dollenstein
66676aaeec
upload to prod pypi from workflow (#697) 2022-06-13 11:27:07 -06:00
Luke Petre
e5ab7b90b4
Drop support for running libcst using a python 3.6 interpreter (#663)
* Drop support for running libcst using a python 3.6 interpreter

* PR feedback
2022-03-24 11:31:48 -04:00
Steven Troxler
bb67d7a6cd
Add a check for copyright headers to lint stage (#648) 2022-02-16 09:57:02 -08:00
Zsolt Dollenstein
3bd8c68207
[ci] build wheels on main branch for linux/arm64 (#630) 2022-01-28 10:31:53 +00:00
Arie Bovenberg
5a1220097d
[ci] add slotscheck (#615)
Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
2022-01-20 18:19:33 +00:00
Zsolt Dollenstein
f2c7cfe00a
[ci] Cache rust build artifacts (#606)
* use Swatinem/rust-cache to cache rust build artifacts

* use rust cache in cibuildwheel on linux
2022-01-19 16:27:39 +00:00
Sehyo Chang
cafbfac150
change pyo3 as optional dependency in native Python Parser (#598) 2022-01-16 18:46:54 +00:00
Luke Petre
9f6ff017f2
Use pyre site-package feature (#589)
* Use pyre site-package feature
* Update readme, remove example
2022-01-07 07:34:50 -05:00
Luke Petre
2f7f174daa
Remove setup matrix (#586) 2022-01-06 11:26:12 -05:00
Zsolt Dollenstein
d9a1dc8473
Fix all type errors (#579)
* bump pyre version
* make sure CI-pyre uses working copy
* remove unused pyre suppressions
* suppress invalid decorations
* fix undefined attributes
* fix missing return annotations
* fix tuple concatenation issues
* add native stubs
* fix invalid typing of **kwargs in test_apply_type_annotations
* only install pyre on non-windows
* update test fixture to reflect changes in recent pyre versions
* suppress errors related to mismatched positions
2022-01-05 18:13:01 +00:00
Zsolt Dollenstein
73ecdf45c3
only run CI on pushes to main and pull requests (#581) 2022-01-05 17:09:30 +00:00
Zsolt Dollenstein
b939bf2998
run tests with 3.10 too (#577) 2022-01-05 15:43:43 +00:00
Zsolt Dollenstein
cff47b767b
fix python version in pypi upload step (#576) 2022-01-04 20:03:59 +00:00
Zsolt Dollenstein
b5fb9d79c5
Fix pypi upload CI step (#570)
* pass in LIBCST_NO_LOCAL_SCHEME to CIBW

* only build a source tarball on one platform

* factor out upload into a separate job
2022-01-04 17:01:09 +00:00
Zsolt Dollenstein
9932a6d339
Implement PEP-634 - Match statement (#568)
* ParenthesizedNode implementation for Box

* match statement rust CST and grammar

* match statement python CST and docs

* run rust unit tests in release mode for now
2021-12-30 10:00:51 +00:00
Zsolt Dollenstein
9c13ca5f9c
pin checkout action to v1 (#569) 2021-12-23 11:51:41 -05:00
Zsolt Dollenstein
c02de9b718
Implement a Python PEG parser in Rust (#566)
This massive PR implements an alternative Python parser that will allow LibCST to parse Python 3.10's new grammar features. The parser is implemented in Rust, but it's turned off by default through the `LIBCST_PARSER_TYPE` environment variable. Set it to `native` to enable. The PR also enables new CI steps that test just the Rust parser, as well as steps that produce binary wheels for a variety of CPython versions and platforms.

Note: this PR aims to be roughly feature-equivalent to the main branch, so it doesn't include new 3.10 syntax features. That will be addressed as a follow-up PR.

The new parser is implemented in the `native/` directory, and is organized into two rust crates: `libcst_derive` contains some macros to facilitate various features of CST nodes, and `libcst` contains the `parser` itself (including the Python grammar), a `tokenizer` implementation by @bgw, and a very basic representation of CST `nodes`. Parsing is done by
1. **tokenizing** the input utf-8 string (bytes are not supported at the Rust layer, they are converted to utf-8 strings by the python wrapper)
2. running the **PEG parser** on the tokenized input, which also captures certain anchor tokens in the resulting syntax tree
3. using the anchor tokens to **inflate** the syntax tree into a proper CST

Co-authored-by: Benjamin Woodruff <github@benjam.info>
2021-12-21 18:14:39 +00:00
Zsolt Dollenstein
2cd43c4b78
disable setuptools local scheme when env var is set (#551) 2021-11-18 15:00:06 +00:00
Luke Petre
5c05001c2d
Publish test packages (#550) 2021-11-18 09:03:27 +00:00
Steven Troxler
5e1e3fe970
The ufmt tool combines usort and black with a consistent wrapper, (#515)
which ensures we won't have inconsistent black-vs-isort errors
going forward. We can always format by running `ufmt format .`
at the root, and check with `ufmt check .` in our CI actions.
2021-08-25 20:39:29 -04:00
Luke Petre
5928f6ad81
Windows CI support (#505)
* Support windows testing in github actions

* Fix path handling in windows
2021-08-12 15:41:23 -04:00
Luke Petre
695f844c6d
Split up some larger CI/tox steps into separate jobs (#511) 2021-08-12 15:18:19 -04:00
Luke Petre
1cceed6df8
Adding python3.9 to the CI (#506) 2021-08-11 17:16:58 +01:00
Luke Petre
398d14e91b
Switch code coverage from tox => gh actions (#510) 2021-08-11 11:41:18 -04:00
Luke Petre
1c3a27bbd5
Add Github Actions and derive version from git tags (#471)
* Use setuptools-scm to derive the current version from git metadata

* Add Github Action equivalent to the current circleci tasks

* Run pyre integration test in GH action / tox
2021-08-10 15:01:16 +01:00