initial package import

This commit is contained in:
Felix Schwarz 2024-08-08 08:40:34 +02:00
commit 8c96abd0b7
4 changed files with 77 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/v2.*.tar.gz

View file

@ -0,0 +1,14 @@
diff --git a/tests/integration_test.py b/tests/integration_test.py
index 6375856..aa65a57 100644
--- a/tests/integration_test.py
+++ b/tests/integration_test.py
@@ -32,7 +32,8 @@ def get_proc(shell, homedir):
'PS1': PS1,
'TOP': os.environ.get('TOP', ''),
'HOME': str(homedir),
- 'PATH': os.path.dirname(sys.executable) + os.defpath
+ 'PATH': os.environ['PATH'],
+ 'PYTHONPATH': os.environ['PYTHONPATH'],
},
)

61
aactivator.spec Normal file
View file

@ -0,0 +1,61 @@
Name: aactivator
Version: 2.0.0
Release: 1%{?dist}
Summary: Automatically source and unsource a project's environment
License: MIT
URL: https://github.com/Yelp/aactivator
Source: %{url}/archive/refs/tags/v%{version}.tar.gz
# The patch is necessary to get most integration tests passing in Fedora's
# build infrastructure.
Patch0: %{name}-set-path-in-integration-tests.patch
BuildArch: noarch
BuildRequires: python3-devel
# required to run the test suite
BuildRequires: python3dist(pexpect)
BuildRequires: python3dist(pytest)
BuildRequires: zsh
%global _description %{expand:
aactivator is a simple tool that automatically sources ("activates") and
unsources a project's environment when entering and exiting it.}
%description %_description
%prep
%autosetup -p1 -n aactivator-%{version}
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l aactivator
%check
# Using pytest-xdist here ("-n auto") leads to DeprecationWarnings from Python:
# DeprecationWarning: This process (pid=...) is multi-threaded, use of
# forkpty() may lead to deadlocks in the child.
# "test_aactivator_goes_missing_no_output" removes the executable "aactivator"
# as part of the test. In addition, getting that test to pass in Fedora's build
# process requires more code changes because the test assumes "aactivator" is
# located in the same directory as the Python executable.
%pytest -x -k "not test_aactivator_goes_missing_no_output"
%files -f %{pyproject_files}
%doc README.md
%{_bindir}/aactivator
%changelog
%autochangelog

1
sources Normal file
View file

@ -0,0 +1 @@
SHA512 (v2.0.0.tar.gz) = e4ca65991fd6e2aba34fbac74b9f1f14d11ea64e68aef245c53e8a56e4f89b3c830fecc5fd77280663bbf1c2cac8c3ee37b93b1c1fe157c66685cd655935eaff