Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: help fmt fmt-check lint check test install dev-install type-check clean all venv activate

PYTHON := python3
SRC_DIR := src/tfe
SRC_DIR := src/pytfe
TEST_DIR := tests
VENV := .venv
VENV_PYTHON := $(VENV)/bin/python
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![PyPI](https://img.shields.io/pypi/v/pytfe.svg)](https://pypi.org/project/pytfe/)
[![Python Versions](https://img.shields.io/pypi/pyversions/pytfe.svg)](https://pypi.org/project/pytfe/)
[![CI](https://github.com/hashicorp/python-tfe/actions/workflows/ci.yml/badge.svg)](https://github.com/hashicorp/python-tfe/actions/workflows/ci.yml)
[![Test](https://github.com/hashicorp/python-tfe/actions/workflows/test.yml/badge.svg)](https://github.com/hashicorp/python-tfe/actions/workflows/test.yml)
[![License](https://img.shields.io/github/license/hashicorp/python-tfe.svg)](./LICENSE)
[![Issues](https://img.shields.io/github/issues/hashicorp/python-tfe.svg)](https://github.com/hashicorp/python-tfe/issues)

Expand Down
12 changes: 6 additions & 6 deletions examples/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
Usage:
export TFE_TOKEN="your-token-here"
export TFE_ORG="your-organization"
python examples/agent_simple.py
python examples/agent.py
"""

import os

from tfe.client import TFEClient
from tfe.config import TFEConfig
from tfe.errors import NotFound
from tfe.models.agent import AgentListOptions
from pytfe.client import TFEClient
from pytfe.config import TFEConfig
from pytfe.errors import NotFound
from pytfe.models import AgentListOptions


def main():
Expand All @@ -45,7 +45,7 @@ def main():

# Create TFE client
config = TFEConfig(token=token, address=address)
client = TFEClient(config=config)
client = TFEClient(config)

print(f"🔗 Connected to: {address}")
print(f"🏢 Organization: {org}")
Expand Down
8 changes: 4 additions & 4 deletions examples/agent_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
Usage:
export TFE_TOKEN="your-token-here"
export TFE_ORG="your-organization"
python examples/agent_pool_simple.py
python examples/agent_pool.py
"""

import os
import uuid

from tfe import TFEClient, TFEConfig
from tfe.errors import NotFound
from tfe.models.agent import (
from pytfe import TFEClient, TFEConfig
from pytfe.errors import NotFound
from pytfe.models import (
AgentPoolAllowedWorkspacePolicy,
AgentPoolCreateOptions,
AgentPoolListOptions,
Expand Down
2 changes: 1 addition & 1 deletion examples/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import argparse
import os

from tfe import TFEClient, TFEConfig
from pytfe import TFEClient, TFEConfig


def _print_header(title: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Complete Configuration Version Testing Suite

This file contains individual tests for all 12 configuration version functions implemented in src/tfe/resources/configuration_version.py:
This file contains individual tests for all 12 configuration version functions:

CONFIGURATION VERSION FUNCTIONS AVAILABLE FOR TESTING:
1. list() - List configuration versions for a workspace
Expand Down Expand Up @@ -35,8 +35,8 @@
# Add the src directory to the path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))

from tfe import TFEClient, TFEConfig
from tfe.models import (
from pytfe import TFEClient, TFEConfig
from pytfe.models import (
ConfigurationVersionCreateOptions,
ConfigurationVersionListOptions,
ConfigurationVersionReadOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Complete OAuth Client Testing Suite

This file contains individual tests for all 8 OAuth client functions implemented in src/tfe/resources/oauth_client.py:
This file contains individual tests for all 8 OAuth client functions:

PUBLIC FUNCTIONS AVAILABLE FOR TESTING:
1. list() - List all OAuth clients for an organization
Expand Down Expand Up @@ -35,9 +35,9 @@
# Add the src directory to the path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))

from tfe import TFEClient, TFEConfig
from tfe.errors import NotFound
from tfe.models.oauth_client import (
from pytfe import TFEClient, TFEConfig
from pytfe.errors import NotFound
from pytfe.models import (
OAuthClientAddProjectsOptions,
OAuthClientCreateOptions,
OAuthClientIncludeOpt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Complete OAuth Token Testing Suite

This file contains individual tests for all 4 OAuth token functions implemented in src/tfe/resources/oauth_token.py:
This file contains individual tests for all 4 OAuth token functions:

FUNCTIONS AVAILABLE FOR TESTING:
1. list() - List OAuth tokens for an organization
Expand All @@ -28,9 +28,9 @@
# Add the src directory to the path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))

from tfe import TFEClient, TFEConfig
from tfe.errors import NotFound
from tfe.models.oauth_token import OAuthTokenListOptions, OAuthTokenUpdateOptions
from pytfe import TFEClient, TFEConfig
from pytfe.errors import NotFound
from pytfe.models import OAuthTokenListOptions, OAuthTokenUpdateOptions


def main():
Expand Down
4 changes: 2 additions & 2 deletions examples/org.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from tfe import TFEClient, TFEConfig
from tfe.types import (
from pytfe import TFEClient, TFEConfig
from pytfe.models import (
DataRetentionPolicyDeleteOlderSetOptions,
DataRetentionPolicyDontDeleteSetOptions,
OrganizationCreateOptions,
Expand Down
2 changes: 1 addition & 1 deletion examples/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import os

from tfe import TFEClient, TFEConfig
from pytfe import TFEClient, TFEConfig


def _print_header(title: str):
Expand Down
6 changes: 3 additions & 3 deletions examples/policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import os
from pathlib import Path

from tfe import TFEClient, TFEConfig
from tfe.models.policy import (
from pytfe import TFEClient, TFEConfig
from pytfe.models import (
EnforcementLevel,
PolicyCreateOptions,
PolicyKind,
PolicyListOptions,
PolicyUpdateOptions,
)
from tfe.models.policy_set import PolicyKind


def _print_header(title: str):
Expand Down
4 changes: 2 additions & 2 deletions examples/policy_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import argparse
import os

from tfe import TFEClient, TFEConfig
from tfe.models.policy_check import PolicyCheckListOptions
from pytfe import TFEClient, TFEConfig
from pytfe.models import PolicyCheckListOptions


def _print_header(title: str):
Expand Down
10 changes: 5 additions & 5 deletions examples/project.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Comprehensive Integration Test for python-tfe Projects CRUD Operations

This file tests all CRUD operations from src/tfe/resources/projects.py:
This file tests all CRUD operations:
- List: Get all projects in an organization
- Create: Add new projects with validation
- Read: Get specific project details
Expand Down Expand Up @@ -29,16 +29,16 @@

import pytest

from tfe._http import HTTPTransport
from tfe.config import TFEConfig
from tfe.resources.projects import Projects
from tfe.types import (
from pytfe._http import HTTPTransport
from pytfe.config import TFEConfig
from pytfe.models import (
ProjectAddTagBindingsOptions,
ProjectCreateOptions,
ProjectListOptions,
ProjectUpdateOptions,
TagBinding,
)
from pytfe.resources.projects import Projects


@pytest.fixture
Expand Down
4 changes: 2 additions & 2 deletions examples/query_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
import time
from datetime import datetime

from tfe import TFEClient, TFEConfig
from tfe.models.query_run import (
from pytfe import TFEClient, TFEConfig
from pytfe.models import (
QueryRunCancelOptions,
QueryRunCreateOptions,
QueryRunForceCancelOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"""
Complete Registry Module Testing Suite

This file contains individual tests for all 15 registry module functions implemented in src/tfe/resources/registry_module.py:
This file contains individual tests for all 15 registry module functions:

PUBLIC FUNCTIONS AVAILABLE FOR TESTING:
1. list() - List registry modules in organization
Expand Down Expand Up @@ -39,9 +39,9 @@
# Add the src directory to the path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))

from tfe import TFEClient, TFEConfig
from tfe.errors import NotFound
from tfe.models.registry_module_types import (
from pytfe import TFEClient, TFEConfig
from pytfe.errors import NotFound
from pytfe.models import (
AgentExecutionMode,
RegistryModuleCreateOptions,
RegistryModuleCreateVersionOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
# Add the src directory to the path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))

from tfe import TFEClient
from tfe.models.registry_provider_types import (
from pytfe import TFEClient
from pytfe.models import (
RegistryName,
RegistryProviderCreateOptions,
RegistryProviderID,
Expand Down
6 changes: 3 additions & 3 deletions examples/reserved_tag_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
# Add the source directory to the path for direct execution
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))

from tfe import TFEClient, TFEConfig
from tfe.errors import TFEError
from tfe.models import (
from pytfe import TFEClient, TFEConfig
from pytfe.errors import TFEError
from pytfe.models import (
ReservedTagKeyCreateOptions,
ReservedTagKeyListOptions,
ReservedTagKeyUpdateOptions,
Expand Down
6 changes: 3 additions & 3 deletions examples/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import os
from datetime import datetime

from tfe import TFEClient, TFEConfig
from tfe.models.run import (
from pytfe import TFEClient, TFEConfig
from pytfe.models import (
RunCreateOptions,
RunIncludeOpt,
RunListForOrganizationOptions,
Expand Down Expand Up @@ -141,7 +141,7 @@ def main():
workspace_data = client.workspaces.read_by_id(args.workspace_id)

# Create the workspace object that run models expect
from tfe.models.workspace import Workspace
from pytfe.models.workspace import Workspace

workspace = Workspace(
id=workspace_data.id,
Expand Down
4 changes: 2 additions & 2 deletions examples/run_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
import argparse
import os

from tfe import TFEClient, TFEConfig
from tfe.models.run_event import (
from pytfe import TFEClient, TFEConfig
from pytfe.models import (
RunEventIncludeOpt,
RunEventListOptions,
RunEventReadOptions,
Expand Down
4 changes: 2 additions & 2 deletions examples/run_task.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import time
import traceback

from tfe import TFEClient, TFEConfig
from tfe.models.run_task import (
from pytfe import TFEClient, TFEConfig
from pytfe.models import (
RunTaskCreateOptions,
RunTaskIncludeOptions,
RunTaskListOptions,
Expand Down
6 changes: 3 additions & 3 deletions examples/run_trigger.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import time
import traceback

from tfe import TFEClient, TFEConfig
from tfe.models.run_trigger import (
from pytfe import TFEClient, TFEConfig
from pytfe.models import (
RunTriggerCreateOptions,
RunTriggerFilterOp,
RunTriggerIncludeOp,
RunTriggerListOptions,
Workspace,
)
from tfe.models.workspace import Workspace


def run_trigger_list(client, workspace_id):
Expand Down
6 changes: 3 additions & 3 deletions examples/ssh_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
# Add the source directory to the path for direct execution
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "src"))

from tfe import TFEClient, TFEConfig
from tfe.errors import NotFound, TFEError
from tfe.models import SSHKeyCreateOptions, SSHKeyListOptions, SSHKeyUpdateOptions
from pytfe import TFEClient, TFEConfig
from pytfe.errors import NotFound, TFEError
from pytfe.models import SSHKeyCreateOptions, SSHKeyListOptions, SSHKeyUpdateOptions

# Configuration
TFE_TOKEN = os.getenv("TFE_TOKEN")
Expand Down
8 changes: 4 additions & 4 deletions examples/state_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
import os
from pathlib import Path

from tfe import TFEClient, TFEConfig
from tfe.errors import ErrStateVersionUploadNotSupported
from tfe.models.state_version import (
from pytfe import TFEClient, TFEConfig
from pytfe.errors import ErrStateVersionUploadNotSupported
from pytfe.models import (
StateVersionCreateOptions,
StateVersionCurrentOptions,
StateVersionListOptions,
StateVersionOutputsListOptions,
)
from tfe.models.state_version_output import StateVersionOutputsListOptions


def _print_header(title: str):
Expand Down
Loading
Loading