Skip to content

Commit

Permalink
Merge branch 'main' into fix-up-dep-report
Browse files Browse the repository at this point in the history
  • Loading branch information
caelean authored Dec 7, 2024
2 parents a0f2e73 + 6b88b51 commit 445467b
Show file tree
Hide file tree
Showing 46 changed files with 1,172 additions and 509 deletions.
20 changes: 11 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tach"
version = "0.16.1"
version = "0.16.3"
edition = "2021"

[lib]
Expand All @@ -24,6 +24,7 @@ serde = { version = "1.0.215", features = ["derive"] }
glob = "0.3.1"
petgraph = "0.6.5"
serde_json = "1.0.133"
tempfile = "3.14.0"

[features]
extension-module = ["pyo3/extension-module"]
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ install: ## Install the crate as module in the current virtualenv

.PHONY: test
test: ## Run tests
cd python/tests && \
../../$(VENV_BIN)/pytest
$(VENV_BIN)/pytest
cargo test


.PHONY: lint fmt lint-rust lint-python fmt-rust fmt-python
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ If you use the [pre-commit framework](https://github.com/pre-commit/pre-commit),
```yaml
repos:
- repo: https://github.com/gauge-sh/tach-pre-commit
rev: v0.16.0 # change this to the latest tag!
rev: v0.16.3 # change this to the latest tag!
hooks:
- id: tach
```
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "tach"
version = "0.16.1"
version = "0.16.3"
authors = [
{ name = "Caelean Barnes", email = "caeleanb@gmail.com" },
{ name = "Evan Doyle", email = "evanmdoyle@gmail.com" },
Expand Down
2 changes: 1 addition & 1 deletion python/tach/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import annotations

__version__ = "0.16.1"
__version__: str = "0.16.3"

__all__ = ["__version__"]
10 changes: 5 additions & 5 deletions python/tach/constants/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from __future__ import annotations

PACKAGE_NAME = "tach"
TOOL_NAME = "tach"
CONFIG_FILE_NAME = TOOL_NAME
PACKAGE_FILE_NAME = "package"
ROOT_MODULE_SENTINEL_TAG = "<root>"
PACKAGE_NAME: str = "tach"
TOOL_NAME: str = "tach"
CONFIG_FILE_NAME: str = TOOL_NAME
PACKAGE_FILE_NAME: str = "package"
ROOT_MODULE_SENTINEL_TAG: str = "<root>"

DEFAULT_EXCLUDE_PATHS = ["tests", "docs", ".*__pycache__", ".*egg-info"]

Expand Down
5 changes: 4 additions & 1 deletion python/tach/extension.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def update_computation_cache(
project_root: str, cache_key: str, value: tuple[list[tuple[int, str]], int]
) -> None: ...
def parse_project_config(filepath: Path) -> tuple[ProjectConfig, bool]: ...
def parse_interface_members(source_roots: list[Path], path: str) -> list[str]: ...
def dump_project_config_to_toml(project_config: ProjectConfig) -> str: ...
def check(
project_root: Path,
Expand Down Expand Up @@ -115,10 +114,13 @@ class ModuleConfig:
def __new__(cls, path: str, strict: bool) -> ModuleConfig: ...
def mod_path(self) -> str: ...

InterfaceDataTypes = Literal["all", "primitive"]

class InterfaceConfig:
expose: list[str]
# 'from' in tach.toml
from_modules: list[str]
data_types: InterfaceDataTypes

CacheBackend = Literal["disk"]

Expand All @@ -139,6 +141,7 @@ RuleSetting = Literal["error", "warn", "off"]

class RulesConfig:
unused_ignore_directives: RuleSetting
require_ignore_directive_reasons: RuleSetting

class ProjectConfig:
modules: list[ModuleConfig]
Expand Down
2 changes: 1 addition & 1 deletion python/tach/modularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def upload_report_to_gauge(


GAUGE_API_KEY = os.getenv("GAUGE_API_KEY", "")
GAUGE_API_BASE_URL = os.getenv("GAUGE_API_BASE_URL", "http://localhost:8000")
GAUGE_API_BASE_URL = os.getenv("GAUGE_API_BASE_URL", "https://app.gauge.sh")


def build_modularity_upload_path(repo: str) -> str:
Expand Down
8 changes: 5 additions & 3 deletions src/check_ext.rs → src/commands/check_external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ use std::path::{Path, PathBuf};

use thiserror::Error;

use crate::external::{
error::ParsingError, parsing::normalize_package_name, parsing::parse_pyproject_toml,
};
use crate::filesystem::relative_to;
use crate::parsing::external::{normalize_package_name, parse_pyproject_toml};
use crate::{filesystem, imports, parsing};
use crate::{filesystem, imports};

#[derive(Error, Debug)]
pub enum ExternalCheckError {
#[error("Parsing error: {0}")]
Parse(#[from] parsing::error::ParsingError),
Parse(#[from] ParsingError),
#[error("Import parsing error: {0}")]
ImportParse(#[from] imports::ImportParseError),
#[error("IO error: {0}")]
Expand Down
Loading

0 comments on commit 445467b

Please sign in to comment.