From lenjaffe at jaffesystems.com Fri Aug 9 09:57:27 2024 From: lenjaffe at jaffesystems.com (Len Jaffe) Date: Fri, 9 Aug 2024 09:57:27 -0400 Subject: [CentralOH] Pytest, FileInput, and captured output In-Reply-To: References: Message-ID: Finally made it back to my python program. Implemented a mini fileinput with a context manager (learned something new). All my tests are passing now. Thanks for the advice. Len. On Sat, Jul 13, 2024, 12:59 AM Len Jaffe wrote: > Just a quick follow-up. Work pulled me into a different project for a > little while. Probably be able to follow-up on this in Monday or Tuesday, > Ave I'll probably implement my own tiny version of File input. > > On Mon, Jul 8, 2024, 8:34 AM Len Jaffe wrote: > >> Yes. Disappointingly, I probably will reimplement FileInput. >> >> I don't really blame it for using stdout. If I wasy implementing a >> per-file prompt, I would too. >> >> Thanks for your advice. >> >> Len. >> >> On Sat, Jul 6, 2024, 9:42 PM Brian Costlow >> wrote: >> >>> Whoops, typo. Hacked off the send of a sentence while pasting. >>> >>> you get much more testable code that doesn't rely on *redirecting >>> writes to std.out.* >>> >>> On Sat, Jul 6, 2024 at 9:40?PM Brian Costlow >>> wrote: >>> >>>> A couple of things come to mind when looking over this exchange. >>>> >>>> If you are just handling a single file, and not a list of files, then >>>> all fileinput buys you is the in-place editing. And all that really does is >>>> move the original file to a backup, writes to a new file using the original >>>> name, and deletes the backup if everything succeeds. >>>> You could do that yourself, and then by using the standard open call, >>>> and some careful refactoring, you get much more testable code that doesn't >>>> rely on >>>> >>>> https://rhodesmill.org/brandon/slides/2015-05-pywaw/hoist/ >>>> >>>> Or, you can keep using fileinput, and maybe use >>>> https://pytest-pyfakefs.readthedocs.io/en/latest/index.html to set up >>>> a mocked in memory filesystem. >>>> >>>> On Fri, Jul 5, 2024 at 12:03?PM Len Jaffe >>>> wrote: >>>> >>>>> Thank Eric. >>>>> I did something similar, explicitly opening a /dev/tty for output - >>>>> hadn't thought about just using stderr. >>>>> >>>>> I'll try that out on Monday. >>>>> >>>>> On Thu, Jul 4, 2024, 4:19 PM Eric Floehr >>>>> wrote: >>>>> >>>>>> Len, >>>>>> >>>>>> This may be a long-shot and it's a bit of a hack, but what about >>>>>> using stderr for output? stderr doesn't get captured by inplace=True. >>>>>> Though I'm not an expert with pytest and what it might do. Or could you >>>>>> create a "prompt_user" function that could take a StringIO object for input >>>>>> and output and pass that through the test since it has a stream-like >>>>>> interface? >>>>>> >>>>>> Here is a quick test I tried, you could in process_file create and >>>>>> pass in StringIO's in a pytest test as well. >>>>>> >>>>>> ------------------- >>>>>> >>>>>> import fileinput >>>>>> import sys >>>>>> >>>>>> def prompt_user(prompt, input_stream=sys.stdin, >>>>>> output_stream=sys.stderr): >>>>>> output_stream.write(prompt) >>>>>> output_stream.flush() >>>>>> return input_stream.readline() >>>>>> >>>>>> def process_file(filename): >>>>>> with fileinput.input(files=(filename,), inplace=True) as f: >>>>>> for line in f: >>>>>> user_input = prompt_user(f"Edit line '{line.strip()}': ") >>>>>> print(user_input if user_input else line, end='') >>>>>> >>>>>> process_file('test.txt') >>>>>> >>>>>> ------------------- >>>>>> >>>>>> Cheers, >>>>>> Eric >>>>>> >>>>>> >>>>>> On Wed, Jul 3, 2024 at 4:32?PM Len Jaffe >>>>>> wrote: >>>>>> >>>>>>> I have a method that present a user prompt, and returns the >>>>>>> respond, and method tests using pytest. >>>>>>> >>>>>>> First draft using print(), input() and pytest capsys.out worked >>>>>>> fine. >>>>>>> >>>>>>> But now I want to move the prompt into another method which is >>>>>>> called inside a FileInput context manager. The FileInput is instantiated >>>>>>> with inplace=True, so I can no longer use stdout for the use prompt since >>>>>>> fileinput uses it for the in-place processing. >>>>>>> >>>>>>> I have no problem opening /dev/tty on new fds to do the prompt and >>>>>>> response, but I'm stumped trying to figure out an alternative solution for >>>>>>> capturing that output in pytest. >>>>>>> >>>>>>> My web searches found nothing of value. Please help. >>>>>>> >>>>>>> Suggestions and advice would be greatly appreciated. >>>>>>> >>>>>>> Len >>>>>>> _______________________________________________ >>>>>>> CentralOH mailing list >>>>>>> CentralOH at python.org >>>>>>> https://mail.python.org/mailman/listinfo/centraloh >>>>>>> >>>>>> _______________________________________________ >>>>>> CentralOH mailing list >>>>>> CentralOH at python.org >>>>>> https://mail.python.org/mailman/listinfo/centraloh >>>>>> >>>>> _______________________________________________ >>>>> CentralOH mailing list >>>>> CentralOH at python.org >>>>> https://mail.python.org/mailman/listinfo/centraloh >>>>> >>>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From lenjaffe at jaffesystems.com Fri Aug 9 12:17:01 2024 From: lenjaffe at jaffesystems.com (Len Jaffe) Date: Fri, 9 Aug 2024 12:17:01 -0400 Subject: [CentralOH] Packaging my module Message-ID: Started looking into packaging my program. What's the good word on packaging: egg? Wheel? Poetry? Started with an egg, now in have a wheel. But the rabbit hole is pulling me towards poetry. Should I heed the call? Thanks. Len -------------- next part -------------- An HTML attachment was scrubbed... URL: From brian.costlow at gmail.com Fri Aug 9 16:08:49 2024 From: brian.costlow at gmail.com (Brian Costlow) Date: Fri, 9 Aug 2024 16:08:49 -0400 Subject: [CentralOH] Packaging my module In-Reply-To: References: Message-ID: Eggs are dead. You want a wheel. Poetry works great, I use it a lot. In that same space there is also Hatch, pdm, and a number of other tools. https://packaging.python.org/en/latest/key_projects/ If you are pushing to PyPI or a private repository, I'd build a wheel and a source distribution were I you. For pure Python packages, there's a little less hassle for someone to grab the sdist and poke through it without installing. Of course if your code is in a public repo, that doesn't matter. On Fri, Aug 9, 2024 at 12:17?PM Len Jaffe wrote: > Started looking into packaging my program. > > What's the good word on packaging: egg? Wheel? Poetry? > > Started with an egg, now in have a wheel. But the rabbit hole is pulling > me towards poetry. Should I heed the call? > > Thanks. > Len > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erik.n.welch at gmail.com Mon Aug 12 15:02:47 2024 From: erik.n.welch at gmail.com (Erik Welch) Date: Mon, 12 Aug 2024 21:02:47 +0200 Subject: [CentralOH] Packaging my module In-Reply-To: References: Message-ID: pyOpenSci has an amazing Python packaging guide. It is oriented to scientific users, but is generally useful, and it covers recommendations for basic packaging needs and more complicated needs such as if you have compiled code or compiled dependencies: https://www.pyopensci.org/python-package-guide/index.html Cheers, Erik On Fri, Aug 9, 2024 at 10:09?PM Brian Costlow wrote: > Eggs are dead. You want a wheel. > > Poetry works great, I use it a lot. In that same space there is also > Hatch, pdm, and a number of other tools. > https://packaging.python.org/en/latest/key_projects/ > If you are pushing to PyPI or a private repository, I'd build a wheel and > a source distribution were I you. For pure Python packages, there's a > little less hassle for someone to grab the sdist and poke through it > without installing. Of course if your code is in a public repo, that > doesn't matter. > > > > On Fri, Aug 9, 2024 at 12:17?PM Len Jaffe > wrote: > >> Started looking into packaging my program. >> >> What's the good word on packaging: egg? Wheel? Poetry? >> >> Started with an egg, now in have a wheel. But the rabbit hole is pulling >> me towards poetry. Should I heed the call? >> >> Thanks. >> Len >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wm.melvin at gmail.com Thu Aug 22 11:06:05 2024 From: wm.melvin at gmail.com (William Melvin) Date: Thu, 22 Aug 2024 11:06:05 -0400 Subject: [CentralOH] Packaging my module In-Reply-To: References: Message-ID: The world of Python packaging keeps evolving. I saw a link to this post on my LinkedIn feed (I forget who shared it): https://astral.sh/blog/uv-unified-python-packaging This is another rusty tool for Python from the folks who make the Ruff linter/formatter, which I do like. I tried uv, in its earlier form as a pip replacement, on a small project earlier this year. At the time, it did not make much difference since the project was small with only a few dependencies - pip was fast enough. I plan to try uv in its new role as an "end-to-end solution for managing Python projects..." Regards, Bill Melvin On Mon, Aug 12, 2024 at 3:02?PM Erik Welch wrote: > pyOpenSci has an amazing Python packaging guide. It is oriented to > scientific users, but is generally useful, and it covers recommendations > for basic packaging needs and more complicated needs such as if you have > compiled code or compiled dependencies: > > https://www.pyopensci.org/python-package-guide/index.html > > Cheers, > Erik > > On Fri, Aug 9, 2024 at 10:09?PM Brian Costlow > wrote: > >> Eggs are dead. You want a wheel. >> >> Poetry works great, I use it a lot. In that same space there is also >> Hatch, pdm, and a number of other tools. >> https://packaging.python.org/en/latest/key_projects/ >> If you are pushing to PyPI or a private repository, I'd build a wheel and >> a source distribution were I you. For pure Python packages, there's a >> little less hassle for someone to grab the sdist and poke through it >> without installing. Of course if your code is in a public repo, that >> doesn't matter. >> >> >> >> On Fri, Aug 9, 2024 at 12:17?PM Len Jaffe >> wrote: >> >>> Started looking into packaging my program. >>> >>> What's the good word on packaging: egg? Wheel? Poetry? >>> >>> Started with an egg, now in have a wheel. But the rabbit hole is pulling >>> me towards poetry. Should I heed the call? >>> >>> Thanks. >>> Len >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lenjaffe at jaffesystems.com Sat Aug 24 13:16:49 2024 From: lenjaffe at jaffesystems.com (Len Jaffe) Date: Sat, 24 Aug 2024 13:16:49 -0400 Subject: [CentralOH] Packaging my module In-Reply-To: References: Message-ID: And work has deprioritized my python program again. Lol. On Thu, Aug 22, 2024, 11:06 AM William Melvin wrote: > The world of Python packaging keeps evolving. I saw a link to this post on > my LinkedIn feed (I forget who shared it): > > https://astral.sh/blog/uv-unified-python-packaging > > This is another rusty tool for Python from the folks who make the Ruff > linter/formatter, which I do like. I tried uv, in its earlier form as a pip > replacement, on a small project earlier this year. At the time, it did not > make much difference since the project was small with only a few > dependencies - pip was fast enough. I plan to try uv in its new role as an > "end-to-end solution for managing Python projects..." > > Regards, > Bill Melvin > > On Mon, Aug 12, 2024 at 3:02?PM Erik Welch wrote: > >> pyOpenSci has an amazing Python packaging guide. It is oriented to >> scientific users, but is generally useful, and it covers recommendations >> for basic packaging needs and more complicated needs such as if you have >> compiled code or compiled dependencies: >> >> https://www.pyopensci.org/python-package-guide/index.html >> >> Cheers, >> Erik >> >> On Fri, Aug 9, 2024 at 10:09?PM Brian Costlow >> wrote: >> >>> Eggs are dead. You want a wheel. >>> >>> Poetry works great, I use it a lot. In that same space there is also >>> Hatch, pdm, and a number of other tools. >>> https://packaging.python.org/en/latest/key_projects/ >>> If you are pushing to PyPI or a private repository, I'd build a wheel >>> and a source distribution were I you. For pure Python packages, there's a >>> little less hassle for someone to grab the sdist and poke through it >>> without installing. Of course if your code is in a public repo, that >>> doesn't matter. >>> >>> >>> >>> On Fri, Aug 9, 2024 at 12:17?PM Len Jaffe >>> wrote: >>> >>>> Started looking into packaging my program. >>>> >>>> What's the good word on packaging: egg? Wheel? Poetry? >>>> >>>> Started with an egg, now in have a wheel. But the rabbit hole is >>>> pulling me towards poetry. Should I heed the call? >>>> >>>> Thanks. >>>> Len >>>> _______________________________________________ >>>> CentralOH mailing list >>>> CentralOH at python.org >>>> https://mail.python.org/mailman/listinfo/centraloh >>>> >>> _______________________________________________ >>> CentralOH mailing list >>> CentralOH at python.org >>> https://mail.python.org/mailman/listinfo/centraloh >>> >> _______________________________________________ >> CentralOH mailing list >> CentralOH at python.org >> https://mail.python.org/mailman/listinfo/centraloh >> > _______________________________________________ > CentralOH mailing list > CentralOH at python.org > https://mail.python.org/mailman/listinfo/centraloh > -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.lairson at gmail.com Fri Aug 30 13:00:44 2024 From: john.lairson at gmail.com (J L) Date: Fri, 30 Aug 2024 13:00:44 -0400 Subject: [CentralOH] Entry Level IT Opening at OSU Message-ID: Hi All, If anyone is looking for an Entry Level IT support position check out R113548 on jobs.osu.edu. job description follows. IT Service Support Analyst location Columbus Campus time type Full time posted on Posted Today job requisition id R113548 Screen reader users may encounter difficulty with this site. For assistance with applying, please contact hr-accessibleapplication at osu.edu. If you have questions while submitting an application, please review these frequently asked questions. Current Employees and Students: If you are currently employed or enrolled as a student at The Ohio State University, please log in to Workday to use the internal application process. Welcome to The Ohio State University's career site. We invite you to apply to positions of interest. In order to ensure your application is complete, you must complete the following: Ensure you have all necessary documents available when starting the application process. You can review the additional job description section on postings for documents that may be required. Prior to submitting your application, please review and update (if necessary) the information in your candidate profile as it will transfer to your application. Job Title: IT Service Support Analyst Department: Fisher College | Information Technology Services Operations Reporting to the Associate Director of Support Services, the IT Service Support Analyst is responsible for installation and configuration of desktop operating systems and application software; assuring client hardware and software adheres to university security requirements; diagnosing and correcting technology hardware and software problems and providing excellent customer service to clients; performs upgrades and rebuilds user workstations with current versions of software; creates and maintains documentation on software and hardware specific to client workstations; assists with classroom support; organizes and maintains work tickets; provides helpdesk support and problem resolution; troubleshoots and solves complex technical issues related to the designated environment. Develops automated solutions to deploy, monitor and audit software distribution. Supports college information security initiatives; monitors, configure and takes corrective action with anti-virus, data loss protection, vulnerability scanning, and asset management systems. Required Qualifications Bachelor?s degree in computer science or other related technology field or equivalent education and experience. 2 years? experience in installation, maintenance, repair and troubleshooting of computer hardware, and software; Experience with automated software and patch management systems; wide range knowledge of education and administrative software, hardware, and related technology; Willingness to update skills as technology evolves; Excellent communication, problem solving, and decision making skills; Must have attention to detail, and maintain a high level of dependability, flexibility, and integrity. Desired Qualifications Basic networking knowledge with DCHP, TCP/IP settings and MAC/IP address. Additional Information: The target hiring range for this job profile is $26.49 - $34.81 per hour. The actual salary paid to an individual will vary based on multiple factors, including but not limited to, education, years of experience, internal equity, etc. Location: Mason Hall (0252) Position Type: Regular Scheduled Hours: 40 Shift: First Shift Final candidates are subject to successful completion of a background check. A drug screen or physical may be required during the post offer process. Regards, John -------------- next part -------------- An HTML attachment was scrubbed... URL: